diff --git a/e2e/__tests__/__snapshots__/showConfig.test.ts.snap b/e2e/__tests__/__snapshots__/showConfig.test.ts.snap index 4ca4895bad34..cc8ed839b6b7 100644 --- a/e2e/__tests__/__snapshots__/showConfig.test.ts.snap +++ b/e2e/__tests__/__snapshots__/showConfig.test.ts.snap @@ -39,7 +39,7 @@ exports[`--showConfig outputs config info and exits 1`] = ` ], "moduleNameMapper": [], "modulePathIgnorePatterns": [], - "name": "[md5 hash]", + "id": "[md5 hash]", "prettierPath": "prettier", "resetMocks": false, "resetModules": false, diff --git a/e2e/__tests__/multiProjectRunner.test.ts b/e2e/__tests__/multiProjectRunner.test.ts index ba4d129e00c1..0a16b592cf5a 100644 --- a/e2e/__tests__/multiProjectRunner.test.ts +++ b/e2e/__tests__/multiProjectRunner.test.ts @@ -347,7 +347,7 @@ test('resolves projects and their properly', () => { }, }), 'project1.conf.json': JSON.stringify({ - name: 'project1', + id: 'project1', rootDir: './project1', // root dir should be this project's directory setupFiles: ['/project1_setup.js'], @@ -357,7 +357,7 @@ test('resolves projects and their properly', () => { 'project1/project1_setup.js': 'global.project1 = true;', 'project2/__tests__/test.test.js': `test('project2', () => expect(global.project2).toBe(true))`, 'project2/project2.conf.json': JSON.stringify({ - name: 'project2', + id: 'project2', rootDir: '../', // root dir is set to the top level setupFiles: ['/project2/project2_setup.js'], // rootDir shold be of the testEnvironment: 'node', @@ -513,13 +513,13 @@ describe("doesn't bleed module file extensions resolution with multiple workers" expect(configs).toHaveLength(2); - const [{name: name1}, {name: name2}] = configs; + const [{id: id1}, {id: id2}] = configs; - expect(name1).toEqual(expect.any(String)); - expect(name2).toEqual(expect.any(String)); - expect(name1).toHaveLength(32); - expect(name2).toHaveLength(32); - expect(name1).not.toEqual(name2); + expect(id1).toEqual(expect.any(String)); + expect(id2).toEqual(expect.any(String)); + expect(id1).toHaveLength(32); + expect(id2).toHaveLength(32); + expect(id1).not.toEqual(id2); const {stderr} = runJest(DIR, [ '--no-watchman', @@ -556,13 +556,13 @@ describe("doesn't bleed module file extensions resolution with multiple workers" expect(configs).toHaveLength(2); - const [{name: name1}, {name: name2}] = configs; + const [{id: id1}, {id: id2}] = configs; - expect(name1).toEqual(expect.any(String)); - expect(name2).toEqual(expect.any(String)); - expect(name1).toHaveLength(32); - expect(name2).toHaveLength(32); - expect(name1).not.toEqual(name2); + expect(id1).toEqual(expect.any(String)); + expect(id2).toEqual(expect.any(String)); + expect(id1).toHaveLength(32); + expect(id2).toHaveLength(32); + expect(id1).not.toEqual(id2); const {stderr} = runJest(DIR, ['--no-watchman', '-w=2']); diff --git a/e2e/__tests__/showConfig.test.ts b/e2e/__tests__/showConfig.test.ts index 3505a9f66c37..6053d457067f 100644 --- a/e2e/__tests__/showConfig.test.ts +++ b/e2e/__tests__/showConfig.test.ts @@ -34,7 +34,7 @@ test('--showConfig outputs config info and exits', () => { .replace(/\\\\\.pnp\\\\\.\[\^[/\\]+\]\+\$/g, '<>') .replace(/\\\\(?:([^.]+?)|$)/g, '/$1') .replace(/"cacheDirectory": "(.+)"/g, '"cacheDirectory": "/tmp/jest"') - .replace(/"name": "(.+)"/g, '"name": "[md5 hash]"') + .replace(/"id": "(.+)"/g, '"id": "[md5 hash]"') .replace(/"version": "(.+)"/g, '"version": "[version]"') .replace(/"maxWorkers": (\d+)/g, '"maxWorkers": "[maxWorkers]"') .replace(/"\S*show-config-test/gm, '"<>') diff --git a/packages/jest-config/src/ValidConfig.ts b/packages/jest-config/src/ValidConfig.ts index 932e7737d904..19ab5cb6c99a 100644 --- a/packages/jest-config/src/ValidConfig.ts +++ b/packages/jest-config/src/ValidConfig.ts @@ -66,6 +66,7 @@ const initialOptions: Config.InitialOptions = { platforms: ['ios', 'android'], throwOnModuleCollision: false, }, + id: 'string', injectGlobals: true, json: false, lastCommit: false, @@ -81,7 +82,6 @@ const initialOptions: Config.InitialOptions = { }, modulePathIgnorePatterns: ['/build/'], modulePaths: ['/shared/vendor/modules'], - name: 'string', noStackTrace: false, notify: false, notifyMode: 'failure-change', diff --git a/packages/jest-config/src/__tests__/normalize.test.ts b/packages/jest-config/src/__tests__/normalize.test.ts index b32f13298686..19e5d834ab41 100644 --- a/packages/jest-config/src/__tests__/normalize.test.ts +++ b/packages/jest-config/src/__tests__/normalize.test.ts @@ -68,7 +68,7 @@ afterEach(() => { (console.warn as unknown as jest.SpyInstance).mockRestore(); }); -it('picks a name based on the rootDir', async () => { +it('picks an id based on the rootDir', async () => { const rootDir = '/root/path/foo'; const expected = createHash('md5') .update('/root/path/foo') @@ -80,32 +80,32 @@ it('picks a name based on the rootDir', async () => { }, {} as Config.Argv, ); - expect(options.name).toBe(expected); + expect(options.id).toBe(expected); }); -it('keeps custom project name based on the projects rootDir', async () => { - const name = 'test'; +it('keeps custom project id based on the projects rootDir', async () => { + const id = 'test'; const {options} = await normalize( { - projects: [{name, rootDir: '/path/to/foo'}], + projects: [{id, rootDir: '/path/to/foo'}], rootDir: '/root/path/baz', }, {} as Config.Argv, ); - expect(options.projects[0].name).toBe(name); + expect(options.projects[0].id).toBe(id); }); -it('keeps custom names based on the rootDir', async () => { +it('keeps custom ids based on the rootDir', async () => { const {options} = await normalize( { - name: 'custom-name', + id: 'custom-id', rootDir: '/root/path/foo', }, {} as Config.Argv, ); - expect(options.name).toBe('custom-name'); + expect(options.id).toBe('custom-id'); }); it('minimal config is stable across runs', async () => { diff --git a/packages/jest-config/src/index.ts b/packages/jest-config/src/index.ts index f9b4c8456218..57c0d98d2c29 100644 --- a/packages/jest-config/src/index.ts +++ b/packages/jest-config/src/index.ts @@ -193,6 +193,7 @@ const groupOptions = ( globalTeardown: options.globalTeardown, globals: options.globals, haste: options.haste, + id: options.id, injectGlobals: options.injectGlobals, moduleDirectories: options.moduleDirectories, moduleFileExtensions: options.moduleFileExtensions, @@ -200,7 +201,6 @@ const groupOptions = ( moduleNameMapper: options.moduleNameMapper, modulePathIgnorePatterns: options.modulePathIgnorePatterns, modulePaths: options.modulePaths, - name: options.name, prettierPath: options.prettierPath, resetMocks: options.resetMocks, resetModules: options.resetModules, diff --git a/packages/jest-config/src/normalize.ts b/packages/jest-config/src/normalize.ts index a8916f55fd3f..4217071915bc 100644 --- a/packages/jest-config/src/normalize.ts +++ b/packages/jest-config/src/normalize.ts @@ -369,8 +369,8 @@ const normalizeMissingOptions = ( configPath: Config.Path | null | undefined, projectIndex: number, ): Config.InitialOptionsWithRootDir => { - if (!options.name) { - options.name = createHash('md5') + if (!options.id) { + options.id = createHash('md5') .update(options.rootDir) // In case we load config from some path that has the same root dir .update(configPath || '') @@ -978,7 +978,7 @@ export default async function normalize( case 'listTests': case 'logHeapUsage': case 'maxConcurrency': - case 'name': + case 'id': case 'noStackTrace': case 'notify': case 'notifyMode': diff --git a/packages/jest-core/src/__tests__/SearchSource.test.ts b/packages/jest-core/src/__tests__/SearchSource.test.ts index 76122f957363..0394a926230e 100644 --- a/packages/jest-core/src/__tests__/SearchSource.test.ts +++ b/packages/jest-core/src/__tests__/SearchSource.test.ts @@ -40,7 +40,7 @@ const toPaths = (tests: Array) => tests.map(({path}) => path); let findMatchingTests: (config: Config.ProjectConfig) => Promise; describe('SearchSource', () => { - const name = 'SearchSource'; + const id = 'SearchSource'; let searchSource: SearchSource; describe('isTestFilePath', () => { @@ -50,7 +50,7 @@ describe('SearchSource', () => { config = ( await normalize( { - name, + id, rootDir: '.', roots: [], }, @@ -71,7 +71,7 @@ describe('SearchSource', () => { config = ( await normalize( { - name, + id, rootDir: '.', roots: [], testMatch: undefined, @@ -121,8 +121,8 @@ describe('SearchSource', () => { it('finds tests matching a pattern via testRegex', async () => { const {options: config} = await normalize( { + id, moduleFileExtensions: ['js', 'jsx', 'txt'], - name, rootDir, testMatch: undefined, testRegex: 'not-really-a-test', @@ -145,8 +145,8 @@ describe('SearchSource', () => { it('finds tests matching a pattern via testMatch', async () => { const {options: config} = await normalize( { + id, moduleFileExtensions: ['js', 'jsx', 'txt'], - name, rootDir, testMatch: ['**/not-really-a-test.txt', '!**/do-not-match-me.txt'], testRegex: '', @@ -169,8 +169,8 @@ describe('SearchSource', () => { it('finds tests matching a JS regex pattern', async () => { const {options: config} = await normalize( { + id, moduleFileExtensions: ['js', 'jsx'], - name, rootDir, testMatch: undefined, testRegex: 'test.jsx?', @@ -191,8 +191,8 @@ describe('SearchSource', () => { it('finds tests matching a JS glob pattern', async () => { const {options: config} = await normalize( { + id, moduleFileExtensions: ['js', 'jsx'], - name, rootDir, testMatch: ['**/test.js?(x)'], testRegex: '', @@ -213,8 +213,8 @@ describe('SearchSource', () => { it('finds tests matching a JS with overriding glob patterns', async () => { const {options: config} = await normalize( { + id, moduleFileExtensions: ['js', 'jsx'], - name, rootDir, testMatch: [ '**/*.js?(x)', @@ -241,7 +241,7 @@ describe('SearchSource', () => { it('finds tests with default file extensions using testRegex', async () => { const {options: config} = await normalize( { - name, + id, rootDir, testMatch: undefined, testRegex, @@ -262,7 +262,7 @@ describe('SearchSource', () => { it('finds tests with default file extensions using testMatch', async () => { const {options: config} = await normalize( { - name, + id, rootDir, testMatch, testRegex: '', @@ -283,7 +283,7 @@ describe('SearchSource', () => { it('finds tests with parentheses in their rootDir when using testMatch', async () => { const {options: config} = await normalize( { - name, + id, rootDir: path.resolve(__dirname, 'test_root_with_(parentheses)'), testMatch: ['**/__testtests__/**/*'], testRegex: undefined, @@ -303,8 +303,8 @@ describe('SearchSource', () => { it('finds tests with similar but custom file extensions', async () => { const {options: config} = await normalize( { + id, moduleFileExtensions: ['js', 'jsx'], - name, rootDir, testMatch, }, @@ -324,8 +324,8 @@ describe('SearchSource', () => { it('finds tests with totally custom foobar file extensions', async () => { const {options: config} = await normalize( { + id, moduleFileExtensions: ['js', 'foobar'], - name, rootDir, testMatch, }, @@ -345,8 +345,8 @@ describe('SearchSource', () => { it('finds tests with many kinds of file extensions', async () => { const {options: config} = await normalize( { + id, moduleFileExtensions: ['js', 'jsx'], - name, rootDir, testMatch, }, @@ -366,7 +366,7 @@ describe('SearchSource', () => { it('finds tests using a regex only', async () => { const {options: config} = await normalize( { - name, + id, rootDir, testMatch: undefined, testRegex, @@ -387,7 +387,7 @@ describe('SearchSource', () => { it('finds tests using a glob only', async () => { const {options: config} = await normalize( { - name, + id, rootDir, testMatch, testRegex: '', @@ -411,7 +411,7 @@ describe('SearchSource', () => { const config = ( await normalize( { - name, + id, rootDir: '.', roots: [], }, @@ -509,7 +509,7 @@ describe('SearchSource', () => { 'haste_impl.js', ), }, - name: 'SearchSource-findRelatedTests-tests', + id: 'SearchSource-findRelatedTests-tests', rootDir, }, {} as Config.Argv, @@ -564,8 +564,8 @@ describe('SearchSource', () => { beforeEach(async () => { const {options: config} = await normalize( { + id, moduleFileExtensions: ['js', 'jsx', 'foobar'], - name, rootDir, testMatch, }, @@ -623,7 +623,7 @@ describe('SearchSource', () => { const config = ( await normalize( { - name, + id, rootDir: '.', roots: ['/foo/bar/prefix'], }, @@ -657,7 +657,7 @@ describe('SearchSource', () => { '../../../jest-haste-map/src/__tests__/haste_impl.js', ), }, - name: 'SearchSource-findRelatedSourcesFromTestsInChangedFiles-tests', + id: 'SearchSource-findRelatedSourcesFromTestsInChangedFiles-tests', rootDir, }, {} as Config.Argv, diff --git a/packages/jest-core/src/lib/__tests__/__snapshots__/logDebugMessages.test.ts.snap b/packages/jest-core/src/lib/__tests__/__snapshots__/logDebugMessages.test.ts.snap index bf5d5881d7f1..42eed07df2dc 100644 --- a/packages/jest-core/src/lib/__tests__/__snapshots__/logDebugMessages.test.ts.snap +++ b/packages/jest-core/src/lib/__tests__/__snapshots__/logDebugMessages.test.ts.snap @@ -26,7 +26,7 @@ exports[`prints the config object 1`] = ` "moduleNameMapper": [], "modulePathIgnorePatterns": [], "modulePaths": [], - "name": "test_name", + "id": "test_name", "prettierPath": "prettier", "resetMocks": false, "resetModules": false, diff --git a/packages/jest-haste-map/src/__tests__/index.test.js b/packages/jest-haste-map/src/__tests__/index.test.js index 90ca7dccf774..2fa639dcc2f2 100644 --- a/packages/jest-haste-map/src/__tests__/index.test.js +++ b/packages/jest-haste-map/src/__tests__/index.test.js @@ -207,8 +207,8 @@ describe('HasteMap', () => { defaultConfig = { extensions: ['js', 'json'], hasteImplModulePath: require.resolve('./haste_impl.js'), + id: 'haste-map-test', maxWorkers: 1, - name: 'haste-map-test', platforms: ['ios', 'android'], resetCache: false, rootDir: path.join('/', 'project'), diff --git a/packages/jest-haste-map/src/index.ts b/packages/jest-haste-map/src/index.ts index 7d847d0f1b23..07968dd05d64 100644 --- a/packages/jest-haste-map/src/index.ts +++ b/packages/jest-haste-map/src/index.ts @@ -63,10 +63,10 @@ type Options = { forceNodeFilesystemAPI?: boolean; hasteImplModulePath?: string; hasteMapModulePath?: string; + id: string; ignorePattern?: HasteRegExp; maxWorkers: number; mocksPattern?: string; - name: string; platforms: Array; resetCache?: boolean; retainAllFiles: boolean; @@ -87,10 +87,10 @@ type InternalOptions = { extensions: Array; forceNodeFilesystemAPI: boolean; hasteImplModulePath?: string; + id: string; ignorePattern?: HasteRegExp; maxWorkers: number; mocksPattern: RegExp | null; - name: string; platforms: Array; resetCache?: boolean; retainAllFiles: boolean; @@ -252,11 +252,11 @@ export default class HasteMap extends EventEmitter { extensions: options.extensions, forceNodeFilesystemAPI: !!options.forceNodeFilesystemAPI, hasteImplModulePath: options.hasteImplModulePath, + id: options.id, maxWorkers: options.maxWorkers, mocksPattern: options.mocksPattern ? new RegExp(options.mocksPattern) : null, - name: options.name, platforms: options.platforms, resetCache: options.resetCache, retainAllFiles: options.retainAllFiles, @@ -312,9 +312,9 @@ export default class HasteMap extends EventEmitter { this._cachePath = HasteMap.getCacheFilePath( this._options.cacheDirectory, - `haste-map-${this._options.name}-${rootDirHash}`, + `haste-map-${this._options.id}-${rootDirHash}`, VERSION, - this._options.name, + this._options.id, this._options.roots .map(root => fastPath.relative(options.rootDir, root)) .join(':'), diff --git a/packages/jest-runner/src/index.ts b/packages/jest-runner/src/index.ts index cd297c3696c5..1cd3f1562567 100644 --- a/packages/jest-runner/src/index.ts +++ b/packages/jest-runner/src/index.ts @@ -160,8 +160,8 @@ export default class TestRunner { ) { const resolvers: Map = new Map(); for (const test of tests) { - if (!resolvers.has(test.context.config.name)) { - resolvers.set(test.context.config.name, { + if (!resolvers.has(test.context.config.id)) { + resolvers.set(test.context.config.id, { config: test.context.config, serializableModuleMap: test.context.moduleMap.toJSON(), }); diff --git a/packages/jest-runner/src/testWorker.ts b/packages/jest-runner/src/testWorker.ts index aca3f40c2680..988f1e210d4c 100644 --- a/packages/jest-runner/src/testWorker.ts +++ b/packages/jest-runner/src/testWorker.ts @@ -59,9 +59,9 @@ const formatError = (error: string | ErrorWithCode): SerializableError => { const resolvers = new Map(); const getResolver = (config: Config.ProjectConfig) => { - const resolver = resolvers.get(config.name); + const resolver = resolvers.get(config.id); if (!resolver) { - throw new Error('Cannot find resolver for: ' + config.name); + throw new Error('Cannot find resolver for: ' + config.id); } return resolver; }; @@ -77,7 +77,7 @@ export function setup(setupData: { const moduleMap = HasteMap.getStatic(config).getModuleMapFromJSON( serializableModuleMap, ); - resolvers.set(config.name, Runtime.createResolver(config, moduleMap)); + resolvers.set(config.id, Runtime.createResolver(config, moduleMap)); } } diff --git a/packages/jest-runtime/src/__mocks__/createRuntime.js b/packages/jest-runtime/src/__mocks__/createRuntime.js index 771204ea03da..63be71fd9a44 100644 --- a/packages/jest-runtime/src/__mocks__/createRuntime.js +++ b/packages/jest-runtime/src/__mocks__/createRuntime.js @@ -69,9 +69,9 @@ module.exports = async function createRuntime(filename, config) { 'haste_impl.js', ), }, + id: 'Runtime-' + filename.replace(/\W/, '-') + '.tests', moduleDirectories: ['node_modules'], moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'json', 'node'], - name: 'Runtime-' + filename.replace(/\W/, '-') + '.tests', rootDir, ...config, moduleNameMapper, diff --git a/packages/jest-runtime/src/index.ts b/packages/jest-runtime/src/index.ts index 8640b45ea405..2d8955c899d8 100644 --- a/packages/jest-runtime/src/index.ts +++ b/packages/jest-runtime/src/index.ts @@ -377,10 +377,10 @@ export default class Runtime { forceNodeFilesystemAPI: config.haste.forceNodeFilesystemAPI, hasteImplModulePath: config.haste.hasteImplModulePath, hasteMapModulePath: config.haste.hasteMapModulePath, + id: config.id, ignorePattern, maxWorkers: options?.maxWorkers || 1, mocksPattern: escapePathForRegex(path.sep + '__mocks__' + path.sep), - name: config.name, platforms: config.haste.platforms || ['ios', 'android'], resetCache: options?.resetCache, retainAllFiles: false, diff --git a/packages/jest-test-sequencer/src/__tests__/test_sequencer.test.js b/packages/jest-test-sequencer/src/__tests__/test_sequencer.test.js index 7950bc02a324..dc809a27bab2 100644 --- a/packages/jest-test-sequencer/src/__tests__/test_sequencer.test.js +++ b/packages/jest-test-sequencer/src/__tests__/test_sequencer.test.js @@ -24,7 +24,7 @@ const context = { cache: true, cacheDirectory: '/cache', haste: {}, - name: 'test', + id: 'test', }, hasteFS: { getSize: path => path.length, @@ -36,7 +36,7 @@ const secondContext = { cache: true, cacheDirectory: '/cache2', haste: {}, - name: 'test2', + id: 'test2', }, hasteFS: { getSize: path => path.length, diff --git a/packages/jest-test-sequencer/src/index.ts b/packages/jest-test-sequencer/src/index.ts index 2637498f36d5..5e2a0b6f2dcb 100644 --- a/packages/jest-test-sequencer/src/index.ts +++ b/packages/jest-test-sequencer/src/index.ts @@ -38,7 +38,7 @@ export default class TestSequencer { const HasteMapClass = HasteMap.getStatic(config); return HasteMapClass.getCacheFilePath( config.cacheDirectory, - 'perf-cache-' + config.name, + 'perf-cache-' + config.id, ); } diff --git a/packages/jest-transform/src/ScriptTransformer.ts b/packages/jest-transform/src/ScriptTransformer.ts index 3591fa294fdf..d1628b186967 100644 --- a/packages/jest-transform/src/ScriptTransformer.ts +++ b/packages/jest-transform/src/ScriptTransformer.ts @@ -197,7 +197,7 @@ class ScriptTransformer { const HasteMapClass = HasteMap.getStatic(this._config); const baseCacheDir = HasteMapClass.getCacheFilePath( this._config.cacheDirectory, - 'jest-transform-cache-' + this._config.name, + 'jest-transform-cache-' + this._config.id, VERSION, ); // Create sub folders based on the cacheKey to avoid creating one diff --git a/packages/jest-transform/src/__tests__/ScriptTransformer.test.ts b/packages/jest-transform/src/__tests__/ScriptTransformer.test.ts index 94ade78a4a2c..30c9ad6be87e 100644 --- a/packages/jest-transform/src/__tests__/ScriptTransformer.test.ts +++ b/packages/jest-transform/src/__tests__/ScriptTransformer.test.ts @@ -294,7 +294,7 @@ describe('ScriptTransformer', () => { config = makeProjectConfig({ cache: true, cacheDirectory: '/cache/', - name: 'test', + id: 'test', rootDir: '/', transformIgnorePatterns: ['/node_modules/'], }); diff --git a/packages/jest-transform/src/__tests__/__snapshots__/ScriptTransformer.test.ts.snap b/packages/jest-transform/src/__tests__/__snapshots__/ScriptTransformer.test.ts.snap index ffa97cef1c0b..912e7cb0a000 100644 --- a/packages/jest-transform/src/__tests__/__snapshots__/ScriptTransformer.test.ts.snap +++ b/packages/jest-transform/src/__tests__/__snapshots__/ScriptTransformer.test.ts.snap @@ -32,6 +32,7 @@ exports[`ScriptTransformer in async mode, passes expected transform options to g "globalTeardown": undefined, "globals": Object {}, "haste": Object {}, + "id": "test", "injectGlobals": true, "moduleDirectories": Array [], "moduleFileExtensions": Array [ @@ -41,7 +42,6 @@ exports[`ScriptTransformer in async mode, passes expected transform options to g "moduleNameMapper": Array [], "modulePathIgnorePatterns": Array [], "modulePaths": Array [], - "name": "test", "prettierPath": "prettier", "resetMocks": false, "resetModules": false, @@ -160,6 +160,7 @@ exports[`ScriptTransformer passes expected transform options to getCacheKey 1`] "globalTeardown": undefined, "globals": Object {}, "haste": Object {}, + "id": "test", "injectGlobals": true, "moduleDirectories": Array [], "moduleFileExtensions": Array [ @@ -169,7 +170,6 @@ exports[`ScriptTransformer passes expected transform options to getCacheKey 1`] "moduleNameMapper": Array [], "modulePathIgnorePatterns": Array [], "modulePaths": Array [], - "name": "test", "prettierPath": "prettier", "resetMocks": false, "resetModules": false, @@ -266,6 +266,7 @@ exports[`ScriptTransformer passes expected transform options to getCacheKeyAsync "globalTeardown": undefined, "globals": Object {}, "haste": Object {}, + "id": "test", "injectGlobals": true, "moduleDirectories": Array [], "moduleFileExtensions": Array [ @@ -275,7 +276,6 @@ exports[`ScriptTransformer passes expected transform options to getCacheKeyAsync "moduleNameMapper": Array [], "modulePathIgnorePatterns": Array [], "modulePaths": Array [], - "name": "test", "prettierPath": "prettier", "resetMocks": false, "resetModules": false, diff --git a/packages/jest-types/src/Config.ts b/packages/jest-types/src/Config.ts index d94e4296b5f5..1d91b42d576a 100644 --- a/packages/jest-types/src/Config.ts +++ b/packages/jest-types/src/Config.ts @@ -173,6 +173,7 @@ export type InitialOptions = Partial<{ globalSetup: string | null | undefined; globalTeardown: string | null | undefined; haste: HasteConfig; + id: string; injectGlobals: boolean; reporters: Array; logHeapUsage: boolean; @@ -188,7 +189,6 @@ export type InitialOptions = Partial<{ }; modulePathIgnorePatterns: Array; modulePaths: Array; - name: string; noStackTrace: boolean; notify: boolean; notifyMode: string; @@ -369,6 +369,7 @@ export type ProjectConfig = { globalTeardown?: string; globals: ConfigGlobals; haste: HasteConfig; + id: string; injectGlobals: boolean; moduleDirectories: Array; moduleFileExtensions: Array; @@ -376,7 +377,6 @@ export type ProjectConfig = { moduleNameMapper: Array<[string, string]>; modulePathIgnorePatterns: Array; modulePaths?: Array; - name: string; prettierPath: string; resetMocks: boolean; resetModules: boolean; diff --git a/packages/jest-validate/src/__tests__/fixtures/jestConfig.ts b/packages/jest-validate/src/__tests__/fixtures/jestConfig.ts index cff071ccb772..a74e2a7b178b 100644 --- a/packages/jest-validate/src/__tests__/fixtures/jestConfig.ts +++ b/packages/jest-validate/src/__tests__/fixtures/jestConfig.ts @@ -81,6 +81,7 @@ const validConfig = { forceExit: false, globals: {}, haste: {}, + id: 'string', logHeapUsage: true, moduleDirectories: ['node_modules'], moduleFileExtensions: ['js', 'json', 'jsx', 'node'], @@ -91,7 +92,6 @@ const validConfig = { }, modulePathIgnorePatterns: ['/build/'], modulePaths: ['/shared/vendor/modules'], - name: 'string', noStackTrace: false, notify: false, notifyMode: 'failure-change', diff --git a/packages/test-utils/src/config.ts b/packages/test-utils/src/config.ts index 9a97135d8d77..aac0149c2293 100644 --- a/packages/test-utils/src/config.ts +++ b/packages/test-utils/src/config.ts @@ -84,6 +84,7 @@ const DEFAULT_PROJECT_CONFIG: Config.ProjectConfig = { globalTeardown: undefined, globals: {}, haste: {}, + id: 'test_name', injectGlobals: true, moduleDirectories: [], moduleFileExtensions: ['js'], @@ -91,7 +92,6 @@ const DEFAULT_PROJECT_CONFIG: Config.ProjectConfig = { moduleNameMapper: [], modulePathIgnorePatterns: [], modulePaths: [], - name: 'test_name', prettierPath: 'prettier', resetMocks: false, resetModules: false,