diff --git a/CHANGELOG.md b/CHANGELOG.md index 92d9a9cd3fdc..45dabec0321a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### Features +- `[jest-config]` [**BREAKING**] Deprecate `setupTestFrameworkScriptFile` in favor of new `setupFilesAfterEnv` ([#7119](https://github.com/facebook/jest/pull/7119)) - `[jest-jasmine2/jest-circus/jest-cli]` Add test.todo ([#6996](https://github.com/facebook/jest/pull/6996)) - `[pretty-format]` Option to not escape strings in diff messages ([#5661](https://github.com/facebook/jest/pull/5661)) - `[jest-haste-map]` Add `getFileIterator` to `HasteFS` for faster file iteration ([#7010](https://github.com/facebook/jest/pull/7010)). diff --git a/TestUtils.js b/TestUtils.js index 8ec57581b94f..a65743e66145 100644 --- a/TestUtils.js +++ b/TestUtils.js @@ -99,7 +99,7 @@ const DEFAULT_PROJECT_CONFIG: ProjectConfig = { roots: [], runner: 'jest-runner', setupFiles: [], - setupTestFrameworkScriptFile: null, + setupFilesAfterEnv: [], skipFilter: false, skipNodeResolution: false, snapshotResolver: null, diff --git a/docs/Configuration.md b/docs/Configuration.md index bef4ec88cbbd..f98882ac147d 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -628,19 +628,21 @@ If you need to restrict your test-runner to only run in serial rather then being Default: `[]` -The paths to modules that run some code to configure or set up the testing environment. Each setupFile will be run once per test file. Since every test runs in its own environment, these scripts will be executed in the testing environment immediately before executing the test code itself. +A list of paths to modules that run some code to configure or set up the testing environment. Each setupFile will be run once per test file. Since every test runs in its own environment, these scripts will be executed in the testing environment immediately before executing the test code itself. -It's also worth noting that `setupFiles` will execute _before_ [`setupTestFrameworkScriptFile`](#setuptestframeworkscriptfile-string). +It's also worth noting that `setupFiles` will execute _before_ [`setupFilesAfterEnv`](#setupFilesAfterEnv-array). -### `setupTestFrameworkScriptFile` [string] +### `setupFilesAfterEnv` [array] -Default: `undefined` +Default: `[]` + +A list of paths to modules that run some code to configure or set up the testing framework before each test. Since [`setupFiles`](#setupfiles-array) executes before the test framework is installed in the environment, this script file presents you the opportunity of running some code immediately after the test framework has been installed in the environment. -The path to a module that runs some code to configure or set up the testing framework before each test. Since [`setupFiles`](#setupfiles-array) executes before the test framework is installed in the environment, this script file presents you the opportunity of running some code immediately after the test framework has been installed in the environment. +If you want a path to be [relative to the root directory of your project](#rootdir-string), please include `` inside a path's string, like `"/a-configs-folder"`. -If you want this path to be [relative to the root directory of your project](#rootdir-string), please include `` inside the path string, like `"/a-configs-folder"`. +For example, Jest ships with several plug-ins to `jasmine` that work by monkey-patching the jasmine API. If you wanted to add even more jasmine plugins to the mix (or if you wanted some custom, project-wide matchers for example), you could do so in these modules. -For example, Jest ships with several plug-ins to `jasmine` that work by monkey-patching the jasmine API. If you wanted to add even more jasmine plugins to the mix (or if you wanted some custom, project-wide matchers for example), you could do so in this module. +_Note: `setupTestFrameworkScriptFile` is deprecated in favor of `setupFilesAfterEnv`._ ### `snapshotResolver` [string] diff --git a/e2e/__tests__/__snapshots__/show_config.test.js.snap b/e2e/__tests__/__snapshots__/show_config.test.js.snap index 2e4b59ee8531..f3982dde87f3 100644 --- a/e2e/__tests__/__snapshots__/show_config.test.js.snap +++ b/e2e/__tests__/__snapshots__/show_config.test.js.snap @@ -45,7 +45,7 @@ exports[`--showConfig outputs config info and exits 1`] = ` ], \\"runner\\": \\"jest-runner\\", \\"setupFiles\\": [], - \\"setupTestFrameworkScriptFile\\": null, + \\"setupFilesAfterEnv\\": [], \\"skipFilter\\": false, \\"snapshotSerializers\\": [], \\"testEnvironment\\": \\"jest-environment-jsdom\\", diff --git a/e2e/__tests__/setup_files_after_env_config.test.js b/e2e/__tests__/setup_files_after_env_config.test.js new file mode 100644 index 000000000000..92066827459c --- /dev/null +++ b/e2e/__tests__/setup_files_after_env_config.test.js @@ -0,0 +1,70 @@ +/** + * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow + */ +'use strict'; + +import fs from 'fs'; +import path from 'path'; +import {json as runWithJson} from '../runJest'; +import {writeFiles} from '../Utils'; + +const DIR = path.resolve(__dirname, '../setup-files-after-env-config'); + +const pkgJsonOutputFilePath = path.join( + process.cwd(), + 'e2e/setup-files-after-env-config/package.json', +); + +afterAll(() => { + fs.unlinkSync(pkgJsonOutputFilePath); +}); + +describe('setupFilesAfterEnv', () => { + it('requires multiple setup files before each file in the suite', () => { + const pkgJson = { + jest: { + setupFilesAfterEnv: ['./setup1.js', './setup2.js'], + }, + }; + + writeFiles(DIR, { + 'package.json': JSON.stringify(pkgJson, null, 2), + }); + + const result = runWithJson('setup-files-after-env-config', [ + 'test1.test.js', + 'test2.test.js', + ]); + + expect(result.json.numTotalTests).toBe(2); + expect(result.json.numPassedTests).toBe(2); + expect(result.json.testResults.length).toBe(2); + expect(result.status).toBe(0); + }); + + it('requires setup files *after* the test runners are required', () => { + const pkgJson = { + jest: { + setupFilesAfterEnv: ['./setup_hooks_into_runner.js'], + }, + }; + + writeFiles(DIR, { + 'package.json': JSON.stringify(pkgJson, null, 2), + }); + + const result = runWithJson('setup-files-after-env-config', [ + 'runner_patch.test.js', + ]); + + expect(result.json.numTotalTests).toBe(1); + expect(result.json.numPassedTests).toBe(1); + expect(result.json.testResults.length).toBe(1); + expect(result.status).toBe(0); + }); +}); diff --git a/e2e/__tests__/setup_test_framework_script_file_cli_config.test.js b/e2e/__tests__/setup_test_framework_script_file_cli_config.test.js deleted file mode 100644 index 4dcd170a08e2..000000000000 --- a/e2e/__tests__/setup_test_framework_script_file_cli_config.test.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @flow - */ -'use strict'; - -import {json as runWithJson} from '../runJest'; - -describe('--setupTestFrameworkScriptFile setup.js', () => { - it('requires a setup file before each file in the suite', () => { - const result = runWithJson('setup-test-framework-script-file-cli-config', [ - '--setupTestFrameworkScriptFile', - './setup1.js', - 'test1.test.js', - 'test2.test.js', - ]); - - expect(result.status).toBe(0); - expect(result.json.numTotalTests).toBe(2); - expect(result.json.numPassedTests).toBe(2); - expect(result.json.testResults.length).toBe(2); - }); - - it('requires setup files *after* the test runners are required', () => { - const result = runWithJson('setup-test-framework-script-file-cli-config', [ - '--setupTestFrameworkScriptFile', - './setup_hooks_into_runner.js', - 'runner_patch.test.js', - ]); - - expect(result.json.numTotalTests).toBe(1); - expect(result.json.numPassedTests).toBe(1); - expect(result.json.testResults.length).toBe(1); - expect(result.status).toBe(0); - }); -}); diff --git a/e2e/setup-test-framework-script-file-cli-config/__tests__/runner_patch.test.js b/e2e/setup-files-after-env-config/__tests__/runner_patch.test.js similarity index 100% rename from e2e/setup-test-framework-script-file-cli-config/__tests__/runner_patch.test.js rename to e2e/setup-files-after-env-config/__tests__/runner_patch.test.js diff --git a/e2e/setup-test-framework-script-file-cli-config/__tests__/test1.test.js b/e2e/setup-files-after-env-config/__tests__/test1.test.js similarity index 100% rename from e2e/setup-test-framework-script-file-cli-config/__tests__/test1.test.js rename to e2e/setup-files-after-env-config/__tests__/test1.test.js diff --git a/e2e/setup-test-framework-script-file-cli-config/__tests__/test2.test.js b/e2e/setup-files-after-env-config/__tests__/test2.test.js similarity index 100% rename from e2e/setup-test-framework-script-file-cli-config/__tests__/test2.test.js rename to e2e/setup-files-after-env-config/__tests__/test2.test.js diff --git a/e2e/setup-test-framework-script-file-cli-config/setup1.js b/e2e/setup-files-after-env-config/setup1.js similarity index 100% rename from e2e/setup-test-framework-script-file-cli-config/setup1.js rename to e2e/setup-files-after-env-config/setup1.js diff --git a/e2e/setup-files-after-env-config/setup2.js b/e2e/setup-files-after-env-config/setup2.js new file mode 100644 index 000000000000..c03a0bc8ad12 --- /dev/null +++ b/e2e/setup-files-after-env-config/setup2.js @@ -0,0 +1,8 @@ +/** + * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +global.definedInSetupFile = true; diff --git a/e2e/setup-test-framework-script-file-cli-config/setup_hooks_into_runner.js b/e2e/setup-files-after-env-config/setup_hooks_into_runner.js similarity index 100% rename from e2e/setup-test-framework-script-file-cli-config/setup_hooks_into_runner.js rename to e2e/setup-files-after-env-config/setup_hooks_into_runner.js diff --git a/e2e/setup-test-framework-script-file-cli-config/package.json b/e2e/setup-test-framework-script-file-cli-config/package.json deleted file mode 100644 index 148788b25446..000000000000 --- a/e2e/setup-test-framework-script-file-cli-config/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "jest": { - "testEnvironment": "node" - } -} diff --git a/jest.config.js b/jest.config.js index 4385ccffd943..8873ad993dd2 100644 --- a/jest.config.js +++ b/jest.config.js @@ -21,7 +21,7 @@ module.exports = { 'e2e/runtime-internal-module-registry/__mocks__', ], projects: ['', '/examples/*/'], - setupTestFrameworkScriptFile: '/testSetupFile.js', + setupFilesAfterEnv: ['/testSetupFile.js'], snapshotSerializers: [ '/packages/pretty-format/build/plugins/convert_ansi.js', ], diff --git a/packages/jest-circus/src/legacy_code_todo_rewrite/jest_adapter.js b/packages/jest-circus/src/legacy_code_todo_rewrite/jest_adapter.js index f40fa28c7ef2..bf2d87b9f4bd 100644 --- a/packages/jest-circus/src/legacy_code_todo_rewrite/jest_adapter.js +++ b/packages/jest-circus/src/legacy_code_todo_rewrite/jest_adapter.js @@ -73,9 +73,7 @@ const jestAdapter = async ( } }); - if (config.setupTestFrameworkScriptFile) { - runtime.requireModule(config.setupTestFrameworkScriptFile); - } + config.setupFilesAfterEnv.forEach(path => runtime.requireModule(path)); runtime.requireModule(testPath); const results = await runAndTransformResultsToJestFormat({ diff --git a/packages/jest-cli/src/cli/args.js b/packages/jest-cli/src/cli/args.js index b374adeba2ef..99e92b21f959 100644 --- a/packages/jest-cli/src/cli/args.js +++ b/packages/jest-cli/src/cli/args.js @@ -501,15 +501,15 @@ export const options = { }, setupFiles: { description: - 'The paths to modules that run some code to configure or ' + + 'A list of paths to modules that run some code to configure or ' + 'set up the testing environment before each test. ', type: 'array', }, - setupTestFrameworkScriptFile: { + setupFilesAfterEnv: { description: - 'The path to a module that runs some code to configure or ' + - 'set up the testing framework before each test.', - type: 'string', + 'A list of paths to modules that run some code to configure or ' + + 'set up the testing framework before each test ', + type: 'array', }, showConfig: { default: undefined, diff --git a/packages/jest-cli/src/lib/__tests__/__snapshots__/init.test.js.snap b/packages/jest-cli/src/lib/__tests__/__snapshots__/init.test.js.snap index 9ec33fc8447b..8f49360f6ebc 100644 --- a/packages/jest-cli/src/lib/__tests__/__snapshots__/init.test.js.snap +++ b/packages/jest-cli/src/lib/__tests__/__snapshots__/init.test.js.snap @@ -138,8 +138,8 @@ module.exports = { // The paths to modules that run some code to configure or set up the testing environment before each test // setupFiles: [], - // The path to a module that runs some code to configure or set up the testing framework before each test - // setupTestFrameworkScriptFile: null, + // A list of paths to modules that run some code to configure or set up the testing framework before each test + // setupFilesAfterEnv: [], // A list of paths to snapshot serializer modules Jest should use for snapshot testing // snapshotSerializers: [], diff --git a/packages/jest-config/src/Defaults.js b/packages/jest-config/src/Defaults.js index 1b549e1059e1..b6aafa6e13ad 100644 --- a/packages/jest-config/src/Defaults.js +++ b/packages/jest-config/src/Defaults.js @@ -61,7 +61,7 @@ export default ({ runTestsByPath: false, runner: 'jest-runner', setupFiles: [], - setupTestFrameworkScriptFile: null, + setupFilesAfterEnv: [], skipFilter: false, snapshotSerializers: [], testEnvironment: 'jest-environment-jsdom', diff --git a/packages/jest-config/src/Deprecated.js b/packages/jest-config/src/Deprecated.js index 907cb2705924..1b21359bba8e 100644 --- a/packages/jest-config/src/Deprecated.js +++ b/packages/jest-config/src/Deprecated.js @@ -53,6 +53,16 @@ export default { Please update your configuration.`, + setupTestFrameworkScriptFile: (options: { + setupTestFrameworkScriptFile: Array, + }) => ` Option ${chalk.bold( + '"setupTestFrameworkScriptFile"', + )} was replaced by configuration ${chalk.bold( + '"setupFilesAfterEnv"', + )}, which supports multiple paths. + + Please update your configuration.`, + testPathDirs: (options: { testPathDirs: Array, }) => ` Option ${chalk.bold('"testPathDirs"')} was replaced by ${chalk.bold( diff --git a/packages/jest-config/src/Descriptions.js b/packages/jest-config/src/Descriptions.js index 6989be5e1dad..48c3b2d321ad 100644 --- a/packages/jest-config/src/Descriptions.js +++ b/packages/jest-config/src/Descriptions.js @@ -61,8 +61,8 @@ export default ({ "Allows you to use a custom runner instead of Jest's default test runner", setupFiles: 'The paths to modules that run some code to configure or set up the testing environment before each test', - setupTestFrameworkScriptFile: - 'The path to a module that runs some code to configure or set up the testing framework before each test', + setupFilesAfterEnv: + 'A list of paths to modules that run some code to configure or set up the testing framework before each test', snapshotSerializers: 'A list of paths to snapshot serializer modules Jest should use for snapshot testing', testEnvironment: 'The test environment that will be used for testing', diff --git a/packages/jest-config/src/ValidConfig.js b/packages/jest-config/src/ValidConfig.js index 8b675b90b7c8..608dc770ab76 100644 --- a/packages/jest-config/src/ValidConfig.js +++ b/packages/jest-config/src/ValidConfig.js @@ -88,7 +88,7 @@ export default ({ runTestsByPath: false, runner: 'jest-runner', setupFiles: ['/setup.js'], - setupTestFrameworkScriptFile: '/testSetupFile.js', + setupFilesAfterEnv: ['/testSetupFile.js'], silent: true, skipFilter: false, skipNodeResolution: false, diff --git a/packages/jest-config/src/__tests__/__snapshots__/normalize.test.js.snap b/packages/jest-config/src/__tests__/__snapshots__/normalize.test.js.snap index ef754afc331b..9eb36c229fa6 100644 --- a/packages/jest-config/src/__tests__/__snapshots__/normalize.test.js.snap +++ b/packages/jest-config/src/__tests__/__snapshots__/normalize.test.js.snap @@ -47,6 +47,29 @@ exports[`rootDir throws if the options is missing a rootDir property 1`] = ` " `; +exports[`setupTestFrameworkScriptFile logs a deprecation warning when \`setupTestFrameworkScriptFile\` is used 1`] = ` +" Deprecation Warning: + + Option \\"setupTestFrameworkScriptFile\\" was replaced by configuration \\"setupFilesAfterEnv\\", which supports multiple paths. + + Please update your configuration. + + Configuration Documentation: + https://jestjs.io/docs/configuration.html +" +`; + +exports[`setupTestFrameworkScriptFile logs an error when \`setupTestFrameworkScriptFile\` and \`setupFilesAfterEnv\` are used 1`] = ` +"Validation Error: + + Options: setupTestFrameworkScriptFile and setupFilesAfterEnv cannot be used together. + Please change your configuration to only use setupFilesAfterEnv. + + Configuration Documentation: + https://jestjs.io/docs/configuration.html +" +`; + exports[`testEnvironment throws on invalid environment names 1`] = ` "Validation Error: diff --git a/packages/jest-config/src/__tests__/normalize.test.js b/packages/jest-config/src/__tests__/normalize.test.js index ff45c3036203..f890d1500786 100644 --- a/packages/jest-config/src/__tests__/normalize.test.js +++ b/packages/jest-config/src/__tests__/normalize.test.js @@ -330,7 +330,7 @@ describe('haste', () => { }); }); -describe('setupTestFrameworkScriptFile', () => { +describe('setupFilesAfterEnv', () => { let Resolver; beforeEach(() => { Resolver = require('jest-resolve'); @@ -344,36 +344,80 @@ describe('setupTestFrameworkScriptFile', () => { const {options} = normalize( { rootDir: '/root/path/foo', - setupTestFrameworkScriptFile: 'bar/baz', + setupFilesAfterEnv: ['bar/baz'], }, {}, ); - expect(options.setupTestFrameworkScriptFile).toEqual(expectedPathFooBar); + expect(options.setupFilesAfterEnv).toEqual([expectedPathFooBar]); }); it('does not change absolute paths', () => { const {options} = normalize( { rootDir: '/root/path/foo', - setupTestFrameworkScriptFile: '/an/abs/path', + setupFilesAfterEnv: ['/an/abs/path'], }, {}, ); - expect(options.setupTestFrameworkScriptFile).toEqual(expectedPathAbs); + expect(options.setupFilesAfterEnv).toEqual([expectedPathAbs]); }); it('substitutes tokens', () => { const {options} = normalize( { rootDir: '/root/path/foo', - setupTestFrameworkScriptFile: '/bar/baz', + setupFilesAfterEnv: ['/bar/baz'], }, {}, ); - expect(options.setupTestFrameworkScriptFile).toEqual(expectedPathFooBar); + expect(options.setupFilesAfterEnv).toEqual([expectedPathFooBar]); + }); +}); + +describe('setupTestFrameworkScriptFile', () => { + let Resolver; + let consoleWarn; + + beforeEach(() => { + console.warn = jest.fn(); + consoleWarn = console.warn; + Resolver = require('jest-resolve'); + Resolver.findNodeModule = jest.fn( + name => + name.startsWith('/') ? name : '/root/path/foo' + path.sep + name, + ); + }); + + afterEach(() => { + console.warn = consoleWarn; + }); + + it('logs a deprecation warning when `setupTestFrameworkScriptFile` is used', () => { + normalize( + { + rootDir: '/root/path/foo', + setupTestFrameworkScriptFile: 'bar/baz', + }, + {}, + ); + + expect(consoleWarn.mock.calls[0][0]).toMatchSnapshot(); + }); + + it('logs an error when `setupTestFrameworkScriptFile` and `setupFilesAfterEnv` are used', () => { + expect(() => + normalize( + { + rootDir: '/root/path/foo', + setupFilesAfterEnv: ['bar/baz'], + setupTestFrameworkScriptFile: 'bar/baz', + }, + {}, + ), + ).toThrowErrorMatchingSnapshot(); }); }); diff --git a/packages/jest-config/src/index.js b/packages/jest-config/src/index.js index 5ac59c067a8d..ec6a856c75f0 100644 --- a/packages/jest-config/src/index.js +++ b/packages/jest-config/src/index.js @@ -184,7 +184,7 @@ const groupOptions = ( roots: options.roots, runner: options.runner, setupFiles: options.setupFiles, - setupTestFrameworkScriptFile: options.setupTestFrameworkScriptFile, + setupFilesAfterEnv: options.setupFilesAfterEnv, skipFilter: options.skipFilter, skipNodeResolution: options.skipNodeResolution, snapshotResolver: options.snapshotResolver, diff --git a/packages/jest-config/src/normalize.js b/packages/jest-config/src/normalize.js index 0bbd7af6b80b..97e568153cc3 100644 --- a/packages/jest-config/src/normalize.js +++ b/packages/jest-config/src/normalize.js @@ -367,6 +367,28 @@ export default function normalize(options: InitialOptions, argv: Argv) { ), ); + if (!options.setupFilesAfterEnv) { + options.setupFilesAfterEnv = []; + } + + if ( + options.setupTestFrameworkScriptFile && + options.setupFilesAfterEnv.length > 0 + ) { + throw createConfigError( + ` Options: ${chalk.bold( + 'setupTestFrameworkScriptFile', + )} and ${chalk.bold('setupFilesAfterEnv')} cannot be used together. + Please change your configuration to only use ${chalk.bold( + 'setupFilesAfterEnv', + )}.`, + ); + } + + if (options.setupTestFrameworkScriptFile) { + options.setupFilesAfterEnv.push(options.setupTestFrameworkScriptFile); + } + if (options.preset) { options = setupPreset(options, options.preset); } @@ -415,6 +437,7 @@ export default function normalize(options: InitialOptions, argv: Argv) { value = normalizeCollectCoverageOnlyFrom(options, key); break; case 'setupFiles': + case 'setupFilesAfterEnv': case 'snapshotSerializers': value = options[key] && @@ -453,7 +476,6 @@ export default function normalize(options: InitialOptions, argv: Argv) { case 'globalTeardown': case 'moduleLoader': case 'runner': - case 'setupTestFrameworkScriptFile': case 'snapshotResolver': case 'testResultsProcessor': case 'testRunner': diff --git a/packages/jest-jasmine2/src/index.js b/packages/jest-jasmine2/src/index.js index a21f98a376cb..b6fef61428b1 100644 --- a/packages/jest-jasmine2/src/index.js +++ b/packages/jest-jasmine2/src/index.js @@ -147,9 +147,7 @@ async function jasmine2( testPath, }); - if (config.setupTestFrameworkScriptFile) { - runtime.requireModule(config.setupTestFrameworkScriptFile); - } + config.setupFilesAfterEnv.forEach(path => runtime.requireModule(path)); if (globalConfig.enabledTestsMap) { env.specFilter = spec => { diff --git a/packages/jest-validate/src/__tests__/fixtures/jest_config.js b/packages/jest-validate/src/__tests__/fixtures/jest_config.js index f7ac1e2a1bc8..31a04cedb0d2 100644 --- a/packages/jest-validate/src/__tests__/fixtures/jest_config.js +++ b/packages/jest-validate/src/__tests__/fixtures/jest_config.js @@ -107,7 +107,7 @@ const validConfig = { rootDir: '/', roots: [''], setupFiles: ['/setup.js'], - setupTestFrameworkScriptFile: '/testSetupFile.js', + setupFilesAfterEnv: ['/testSetupFile.js'], silent: true, snapshotSerializers: ['my-serializer-module'], testEnvironment: 'jest-environment-jsdom', diff --git a/types/Argv.js b/types/Argv.js index cc552d883996..966c82327dbd 100644 --- a/types/Argv.js +++ b/types/Argv.js @@ -71,7 +71,7 @@ export type Argv = {| roots: Array, runInBand: boolean, setupFiles: Array, - setupTestFrameworkScriptFile: string, + setupFilesAfterEnv: Array, showConfig: boolean, silent: boolean, snapshotSerializers: Array, diff --git a/types/Config.js b/types/Config.js index 569c49b55d61..7de867ffcbf9 100644 --- a/types/Config.js +++ b/types/Config.js @@ -65,7 +65,7 @@ export type DefaultOptions = {| runner: string, runTestsByPath: boolean, setupFiles: Array, - setupTestFrameworkScriptFile: ?Path, + setupFilesAfterEnv: Array, skipFilter: boolean, snapshotSerializers: Array, testEnvironment: string, @@ -151,6 +151,7 @@ export type InitialOptions = { scriptPreprocessor?: string, setupFiles?: Array, setupTestFrameworkScriptFile?: Path, + setupFilesAfterEnv?: Array, silent?: boolean, skipFilter?: boolean, skipNodeResolution?: boolean, @@ -272,7 +273,7 @@ export type ProjectConfig = {| roots: Array, runner: string, setupFiles: Array, - setupTestFrameworkScriptFile: ?Path, + setupFilesAfterEnv: Array, skipFilter: boolean, skipNodeResolution: boolean, snapshotResolver: ?Path,