blob: 754ed087c308d4ffdfcc4d0fe5ee9d06c304419a [file] [log] [blame]
/**
* @license
* Copyright 2021 The Go Authors. All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file.
*/
let config = {
preset: 'ts-jest',
globals: {
'ts-jest': {
isolatedModules: true,
},
},
moduleFileExtensions: ['ts', 'js'],
testRunner: 'jest-circus/runner',
};
// eslint-disable-next-line no-undef
const e2e = process.argv.some(arg => arg.includes('e2e'));
if (e2e) {
config = {
...config,
setupFilesAfterEnv: ['<rootDir>/e2e/setup.ts'],
globalSetup: '<rootDir>/e2e/global-setup.ts',
globalTeardown: '<rootDir>/e2e/global-teardown.ts',
testEnvironment: '<rootDir>/e2e/test-environment.js',
testTimeout: 60000,
};
}
// eslint-disable-next-line no-undef
module.exports = config;