diff --git a/packages/jest-core/src/__tests__/TestScheduler.test.js b/packages/jest-core/src/__tests__/TestScheduler.test.js index 7b6f4e54dbba..b707ef3289c9 100644 --- a/packages/jest-core/src/__tests__/TestScheduler.test.js +++ b/packages/jest-core/src/__tests__/TestScheduler.test.js @@ -16,20 +16,16 @@ const mockSerialRunner = { isSerial: true, runTests: jest.fn(), }; -jest.mock( - `${__dirname}/jest-runner-serial`, - () => jest.fn(() => mockSerialRunner), - {virtual: true}, -); +jest.mock('jest-runner-serial', () => jest.fn(() => mockSerialRunner), { + virtual: true, +}); const mockParallelRunner = { runTests: jest.fn(), }; -jest.mock( - `${__dirname}/jest-runner-parallel`, - () => jest.fn(() => mockParallelRunner), - {virtual: true}, -); +jest.mock('jest-runner-parallel', () => jest.fn(() => mockParallelRunner), { + virtual: true, +}); const spyShouldRunInBand = jest.spyOn(testSchedulerHelper, 'shouldRunInBand'); @@ -93,7 +89,7 @@ test('schedule tests run in parallel per default', async () => { context: { config: makeProjectConfig({ moduleFileExtensions: ['.js'], - runner: `${__dirname}/jest-runner-parallel`, + runner: 'jest-runner-parallel', transform: [], }), hasteFS: { @@ -116,7 +112,7 @@ test('schedule tests run in serial if the runner flags them', async () => { context: { config: makeProjectConfig({ moduleFileExtensions: ['.js'], - runner: `${__dirname}/jest-runner-serial`, + runner: 'jest-runner-serial', transform: [], }), hasteFS: { @@ -140,7 +136,7 @@ test('should bail after `n` failures', async () => { config: makeProjectConfig({ moduleFileExtensions: ['.js'], rootDir: './', - runner: `${__dirname}/jest-runner-serial`, + runner: 'jest-runner-serial', transform: [], }), hasteFS: { @@ -172,7 +168,7 @@ test('should not bail if less than `n` failures', async () => { config: makeProjectConfig({ moduleFileExtensions: ['.js'], rootDir: './', - runner: `${__dirname}/jest-runner-serial`, + runner: 'jest-runner-serial', transform: [], }), hasteFS: { @@ -203,7 +199,7 @@ test('should set runInBand to run in serial', async () => { context: { config: makeProjectConfig({ moduleFileExtensions: ['.js'], - runner: `${__dirname}/jest-runner-parallel`, + runner: 'jest-runner-parallel', transform: [], }), hasteFS: { @@ -229,7 +225,7 @@ test('should set runInBand to not run in serial', async () => { context: { config: makeProjectConfig({ moduleFileExtensions: ['.js'], - runner: `${__dirname}/jest-runner-parallel`, + runner: 'jest-runner-parallel', transform: [], }), hasteFS: { diff --git a/packages/jest-transform/src/__tests__/ScriptTransformer.test.ts b/packages/jest-transform/src/__tests__/ScriptTransformer.test.ts index 15512d12cef0..94ade78a4a2c 100644 --- a/packages/jest-transform/src/__tests__/ScriptTransformer.test.ts +++ b/packages/jest-transform/src/__tests__/ScriptTransformer.test.ts @@ -52,10 +52,9 @@ jest .mock('path', () => jest.requireActual('path').posix); jest.mock( - `${__dirname}/test_preprocessor`, + 'test_preprocessor', () => { - const escapeStrings = (str: string) => - str.replace(/'/, `'`).replace(new RegExp(__dirname, 'g'), ''); + const escapeStrings = (str: string) => str.replace(/'/, `'`); const transformer: Transformer = { getCacheKey: jest.fn(() => 'ab'), @@ -74,10 +73,9 @@ jest.mock( ); jest.mock( - `${__dirname}/test_async_preprocessor`, + 'test_async_preprocessor', () => { - const escapeStrings = (str: string) => - str.replace(/'/, `'`).replace(new RegExp(__dirname, 'g'), ''); + const escapeStrings = (str: string) => str.replace(/'/, `'`); const transformer: Transformer = { getCacheKeyAsync: jest.fn().mockResolvedValue('ab'), @@ -97,7 +95,7 @@ jest.mock( ); jest.mock( - `${__dirname}/configureable-preprocessor`, + 'configureable-preprocessor', () => ({ createTransformer: jest.fn(() => ({ process: jest.fn(() => 'processedCode'), @@ -107,7 +105,7 @@ jest.mock( ); jest.mock( - `${__dirname}/cache_fs_preprocessor`, + 'cache_fs_preprocessor', () => ({ getCacheKey: jest.fn(() => 'ab'), process: jest.fn(() => 'processedCode'), @@ -116,7 +114,7 @@ jest.mock( ); jest.mock( - `${__dirname}/cache_fs_async_preprocessor`, + 'cache_fs_async_preprocessor', () => ({ getCacheKeyAsync: jest.fn().mockResolvedValue('ab'), processAsync: jest.fn().mockResolvedValue('processedCode'), @@ -125,7 +123,7 @@ jest.mock( ); jest.mock( - `${__dirname}/preprocessor-with-sourcemaps`, + 'preprocessor-with-sourcemaps', () => ({ getCacheKey: jest.fn(() => 'ab'), process: jest.fn(), @@ -134,7 +132,7 @@ jest.mock( ); jest.mock( - `${__dirname}/async-preprocessor-with-sourcemaps`, + 'async-preprocessor-with-sourcemaps', () => ({ getCacheKeyAsync: jest.fn(() => 'ab'), processAsync: jest.fn(), @@ -143,7 +141,7 @@ jest.mock( ); jest.mock( - `${__dirname}/css-preprocessor`, + 'css-preprocessor', () => { const transformer: Transformer = { getCacheKey: jest.fn(() => 'cd'), @@ -160,34 +158,30 @@ jest.mock( {virtual: true}, ); -jest.mock( - `${__dirname}/passthrough-preprocessor`, - () => ({process: jest.fn()}), - {virtual: true}, -); - -// Bad preprocessor -jest.mock(`${__dirname}/skipped-required-props-preprocessor`, () => ({}), { +jest.mock('passthrough-preprocessor', () => ({process: jest.fn()}), { virtual: true, }); +// Bad preprocessor +jest.mock('skipped-required-props-preprocessor', () => ({}), {virtual: true}); + // Bad preprocessor jest.mock( - `${__dirname}/skipped-required-props-preprocessor-only-sync`, + 'skipped-required-props-preprocessor-only-sync', () => ({process: () => ''}), {virtual: true}, ); // Bad preprocessor jest.mock( - `${__dirname}/skipped-required-props-preprocessor-only-async`, + 'skipped-required-props-preprocessor-only-async', () => ({processAsync: async () => ''}), {virtual: true}, ); // Bad preprocessor jest.mock( - `${__dirname}/skipped-required-create-transformer-props-preprocessor`, + 'skipped-required-create-transformer-props-preprocessor', () => ({ createTransformer() { return {}; @@ -197,7 +191,7 @@ jest.mock( ); jest.mock( - `${__dirname}/skipped-process-method-preprocessor`, + 'skipped-process-method-preprocessor', () => ({ createTransformer() { return {process: jest.fn(() => 'code')}; @@ -207,7 +201,7 @@ jest.mock( ); jest.mock( - `${__dirname}/factory-for-async-preprocessor`, + 'factory-for-async-preprocessor', () => ({ createTransformer() { return {processAsync: jest.fn().mockResolvedValue('code')}; @@ -406,7 +400,7 @@ describe('ScriptTransformer', () => { it("throws an error if `process` doesn't return a string or an object containing `code` key with processed string", async () => { config = { ...config, - transform: [['\\.js$', `${__dirname}/passthrough-preprocessor`, {}]], + transform: [['\\.js$', 'passthrough-preprocessor', {}]], }; const scriptTransformer = await createScriptTransformer(config); @@ -418,9 +412,7 @@ describe('ScriptTransformer', () => { incorrectReturnValues.forEach(([returnValue, filePath]) => { invariant(typeof filePath === 'string'); - require(`${__dirname}/passthrough-preprocessor`).process.mockReturnValue( - returnValue, - ); + require('passthrough-preprocessor').process.mockReturnValue(returnValue); expect(() => scriptTransformer.transform(filePath, getCoverageOptions()), ).toThrow('must return a string'); @@ -433,9 +425,7 @@ describe('ScriptTransformer', () => { correctReturnValues.forEach(([returnValue, filePath]) => { invariant(typeof filePath === 'string'); - require(`${__dirname}/passthrough-preprocessor`).process.mockReturnValue( - returnValue, - ); + require('passthrough-preprocessor').process.mockReturnValue(returnValue); expect(() => scriptTransformer.transform(filePath, getCoverageOptions()), ).not.toThrow(); @@ -455,7 +445,7 @@ describe('ScriptTransformer', () => { ]; const buildPromise = async ([returnValue, filePath]): Promise => { - const processorName = `${__dirname}/passthrough-preprocessor${filePath.replace( + const processorName = `passthrough-preprocessor${filePath.replace( /\.|\//g, '-', )}`; @@ -499,9 +489,7 @@ describe('ScriptTransformer', () => { it('throws an error if neither `process` nor `processAsync is defined', async () => { config = { ...config, - transform: [ - ['\\.js$', `${__dirname}/skipped-required-props-preprocessor`, {}], - ], + transform: [['\\.js$', 'skipped-required-props-preprocessor', {}]], }; await expect(() => createScriptTransformer(config)).rejects.toThrow( 'Jest: a transform must export a `process` or `processAsync` function.', @@ -512,18 +500,14 @@ describe('ScriptTransformer', () => { config = { ...config, transform: [ - [ - '\\.js$', - `${__dirname}/skipped-required-props-preprocessor-only-async`, - {}, - ], + ['\\.js$', 'skipped-required-props-preprocessor-only-async', {}], ], }; const scriptTransformer = await createScriptTransformer(config); expect(() => scriptTransformer.transformSource('sample.js', '', {instrument: false}), ).toThrow( - `Jest: synchronous transformer ${__dirname}/skipped-required-props-preprocessor-only-async must export a "process" function.`, + 'Jest: synchronous transformer skipped-required-props-preprocessor-only-async must export a "process" function.', ); }); @@ -531,11 +515,7 @@ describe('ScriptTransformer', () => { config = { ...config, transform: [ - [ - '\\.js$', - `${__dirname}/skipped-required-props-preprocessor-only-sync`, - {}, - ], + ['\\.js$', 'skipped-required-props-preprocessor-only-sync', {}], ], }; const scriptTransformer = await createScriptTransformer(config); @@ -552,7 +532,7 @@ describe('ScriptTransformer', () => { transform: [ [ '\\.js$', - `${__dirname}/skipped-required-create-transformer-props-preprocessor`, + 'skipped-required-create-transformer-props-preprocessor', {}, ], ], @@ -565,9 +545,7 @@ describe('ScriptTransformer', () => { it("shouldn't throw error without process method. But with correct createTransformer method", async () => { config = { ...config, - transform: [ - ['\\.js$', `${__dirname}/skipped-process-method-preprocessor`, {}], - ], + transform: [['\\.js$', 'skipped-process-method-preprocessor', {}]], }; const scriptTransformer = await createScriptTransformer(config); expect(() => @@ -579,12 +557,8 @@ describe('ScriptTransformer', () => { config = { ...config, transform: [ - ['async-sample.js', `${__dirname}/factory-for-async-preprocessor`, {}], - [ - 'sync-sample.js', - `${__dirname}/skipped-process-method-preprocessor`, - {}, - ], + ['async-sample.js', 'factory-for-async-preprocessor', {}], + ['sync-sample.js', 'skipped-process-method-preprocessor', {}], ], }; const scriptTransformer = await createScriptTransformer(config); @@ -603,17 +577,14 @@ describe('ScriptTransformer', () => { }); it('uses the supplied preprocessor', async () => { - config = { - ...config, - transform: [['\\.js$', `${__dirname}/test_preprocessor`, {}]], - }; + config = {...config, transform: [['\\.js$', 'test_preprocessor', {}]]}; const scriptTransformer = await createScriptTransformer(config); const res1 = scriptTransformer.transform( '/fruits/banana.js', getCoverageOptions(), ); - expect(require(`${__dirname}/test_preprocessor`).getCacheKey).toBeCalled(); + expect(require('test_preprocessor').getCacheKey).toBeCalled(); expect(wrap(res1.code)).toMatchSnapshot(); @@ -626,17 +597,14 @@ describe('ScriptTransformer', () => { }); it('in async mode, uses the supplied preprocessor', async () => { - config = { - ...config, - transform: [['\\.js$', `${__dirname}/test_preprocessor`, {}]], - }; + config = {...config, transform: [['\\.js$', 'test_preprocessor', {}]]}; const scriptTransformer = await createScriptTransformer(config); const res1 = await scriptTransformer.transformAsync( '/fruits/banana.js', getCoverageOptions(), ); - expect(require(`${__dirname}/test_preprocessor`).getCacheKey).toBeCalled(); + expect(require('test_preprocessor').getCacheKey).toBeCalled(); expect(wrap(res1.code)).toMatchSnapshot(); @@ -651,7 +619,7 @@ describe('ScriptTransformer', () => { it('in async mode, uses the supplied async preprocessor', async () => { config = { ...config, - transform: [['\\.js$', `${__dirname}/test_async_preprocessor`, {}]], + transform: [['\\.js$', 'test_async_preprocessor', {}]], }; const scriptTransformer = await createScriptTransformer(config); const res1 = await scriptTransformer.transformAsync( @@ -659,9 +627,7 @@ describe('ScriptTransformer', () => { getCoverageOptions(), ); - expect( - require(`${__dirname}/test_async_preprocessor`).getCacheKeyAsync, - ).toBeCalled(); + expect(require('test_async_preprocessor').getCacheKeyAsync).toBeCalled(); expect(wrap(res1.code)).toMatchSnapshot(); @@ -677,8 +643,8 @@ describe('ScriptTransformer', () => { config = { ...config, transform: [ - ['\\.js$', `${__dirname}/test_preprocessor`, {}], - ['\\.css$', `${__dirname}/css-preprocessor`, {}], + ['\\.js$', 'test_preprocessor', {}], + ['\\.css$', 'css-preprocessor', {}], ], }; const scriptTransformer = await createScriptTransformer(config); @@ -692,8 +658,8 @@ describe('ScriptTransformer', () => { getCoverageOptions(), ); - expect(require(`${__dirname}/test_preprocessor`).getCacheKey).toBeCalled(); - expect(require(`${__dirname}/css-preprocessor`).getCacheKey).toBeCalled(); + expect(require('test_preprocessor').getCacheKey).toBeCalled(); + expect(require('css-preprocessor').getCacheKey).toBeCalled(); expect(wrap(res1.code)).toMatchSnapshot(); expect(wrap(res2.code)).toMatchSnapshot(); @@ -709,8 +675,8 @@ describe('ScriptTransformer', () => { config = { ...config, transform: [ - ['\\.js$', `${__dirname}/test_async_preprocessor`, {}], - ['\\.css$', `${__dirname}/css-preprocessor`, {}], + ['\\.js$', 'test_async_preprocessor', {}], + ['\\.css$', 'css-preprocessor', {}], ], }; const scriptTransformer = await createScriptTransformer(config); @@ -724,10 +690,8 @@ describe('ScriptTransformer', () => { getCoverageOptions(), ); - expect( - require(`${__dirname}/test_async_preprocessor`).getCacheKeyAsync, - ).toBeCalled(); - expect(require(`${__dirname}/css-preprocessor`).getCacheKey).toBeCalled(); + expect(require('test_async_preprocessor').getCacheKeyAsync).toBeCalled(); + expect(require('css-preprocessor').getCacheKey).toBeCalled(); expect(wrap(res1.code)).toMatchSnapshot(); expect(wrap(res2.code)).toMatchSnapshot(); @@ -742,7 +706,7 @@ describe('ScriptTransformer', () => { it('writes source map if preprocessor supplies it', async () => { config = { ...config, - transform: [['\\.js$', `${__dirname}/preprocessor-with-sourcemaps`, {}]], + transform: [['\\.js$', 'preprocessor-with-sourcemaps', {}]], }; const scriptTransformer = await createScriptTransformer(config); @@ -751,12 +715,10 @@ describe('ScriptTransformer', () => { version: 3, }; - require(`${__dirname}/preprocessor-with-sourcemaps`).process.mockReturnValue( - { - code: 'content', - map, - }, - ); + require('preprocessor-with-sourcemaps').process.mockReturnValue({ + code: 'content', + map, + }); const result = scriptTransformer.transform( '/fruits/banana.js', @@ -774,7 +736,7 @@ describe('ScriptTransformer', () => { it('in async mode, writes source map if preprocessor supplies it', async () => { config = { ...config, - transform: [['\\.js$', `${__dirname}/preprocessor-with-sourcemaps`, {}]], + transform: [['\\.js$', 'preprocessor-with-sourcemaps', {}]], }; const scriptTransformer = await createScriptTransformer(config); @@ -783,12 +745,10 @@ describe('ScriptTransformer', () => { version: 3, }; - require(`${__dirname}/preprocessor-with-sourcemaps`).process.mockReturnValue( - { - code: 'content', - map, - }, - ); + require('preprocessor-with-sourcemaps').process.mockReturnValue({ + code: 'content', + map, + }); const result = await scriptTransformer.transformAsync( '/fruits/banana.js', @@ -806,9 +766,7 @@ describe('ScriptTransformer', () => { it('in async mode, writes source map if async preprocessor supplies it', async () => { config = { ...config, - transform: [ - ['\\.js$', `${__dirname}/async-preprocessor-with-sourcemaps`, {}], - ], + transform: [['\\.js$', 'async-preprocessor-with-sourcemaps', {}]], }; const scriptTransformer = await createScriptTransformer(config); @@ -817,7 +775,7 @@ describe('ScriptTransformer', () => { version: 3, }; - require(`${__dirname}/async-preprocessor-with-sourcemaps`).processAsync.mockResolvedValue( + require('async-preprocessor-with-sourcemaps').processAsync.mockResolvedValue( { code: 'content', map, @@ -840,7 +798,7 @@ describe('ScriptTransformer', () => { it('writes source map if preprocessor inlines it', async () => { config = { ...config, - transform: [['\\.js$', `${__dirname}/preprocessor-with-sourcemaps`, {}]], + transform: [['\\.js$', 'preprocessor-with-sourcemaps', {}]], }; const scriptTransformer = await createScriptTransformer(config); @@ -854,9 +812,7 @@ describe('ScriptTransformer', () => { '//# sourceMappingURL=data:application/json;base64,' + Buffer.from(sourceMap).toString('base64'); - require(`${__dirname}/preprocessor-with-sourcemaps`).process.mockReturnValue( - content, - ); + require('preprocessor-with-sourcemaps').process.mockReturnValue(content); const result = scriptTransformer.transform( '/fruits/banana.js', @@ -874,7 +830,7 @@ describe('ScriptTransformer', () => { it('in async mode, writes source map if preprocessor inlines it', async () => { config = { ...config, - transform: [['\\.js$', `${__dirname}/preprocessor-with-sourcemaps`, {}]], + transform: [['\\.js$', 'preprocessor-with-sourcemaps', {}]], }; const scriptTransformer = await createScriptTransformer(config); @@ -888,9 +844,7 @@ describe('ScriptTransformer', () => { '//# sourceMappingURL=data:application/json;base64,' + Buffer.from(sourceMap).toString('base64'); - require(`${__dirname}/preprocessor-with-sourcemaps`).process.mockReturnValue( - content, - ); + require('preprocessor-with-sourcemaps').process.mockReturnValue(content); const result = await scriptTransformer.transformAsync( '/fruits/banana.js', @@ -908,9 +862,7 @@ describe('ScriptTransformer', () => { it('writes source map if async preprocessor inlines it', async () => { config = { ...config, - transform: [ - ['\\.js$', `${__dirname}/async-preprocessor-with-sourcemaps`, {}], - ], + transform: [['\\.js$', 'async-preprocessor-with-sourcemaps', {}]], }; const scriptTransformer = await createScriptTransformer(config); @@ -924,7 +876,7 @@ describe('ScriptTransformer', () => { '//# sourceMappingURL=data:application/json;base64,' + Buffer.from(sourceMap).toString('base64'); - require(`${__dirname}/async-preprocessor-with-sourcemaps`).processAsync.mockResolvedValue( + require('async-preprocessor-with-sourcemaps').processAsync.mockResolvedValue( content, ); @@ -947,7 +899,7 @@ describe('ScriptTransformer', () => { config = { ...config, - transform: [['\\.js$', `${__dirname}/preprocessor-with-sourcemaps`, {}]], + transform: [['\\.js$', 'preprocessor-with-sourcemaps', {}]], }; const scriptTransformer = await createScriptTransformer(config); @@ -962,9 +914,7 @@ describe('ScriptTransformer', () => { '//# sourceMappingURL=data:application/json;base64,' + Buffer.from(sourceMap).toString('base64').slice(0, 16); - require(`${__dirname}/preprocessor-with-sourcemaps`).process.mockReturnValue( - content, - ); + require('preprocessor-with-sourcemaps').process.mockReturnValue(content); const result = scriptTransformer.transform( '/fruits/banana.js', @@ -974,14 +924,7 @@ describe('ScriptTransformer', () => { expect(writeFileAtomic.sync).toBeCalledTimes(1); expect(console.warn).toHaveBeenCalledTimes(1); - expect( - wrap( - console.warn.mock.calls[0][0].replace( - new RegExp(__dirname, 'g'), - '', - ), - ), - ).toMatchSnapshot(); + expect(wrap(console.warn.mock.calls[0][0])).toMatchSnapshot(); console.warn = warn; }); @@ -991,7 +934,7 @@ describe('ScriptTransformer', () => { config = { ...config, - transform: [['\\.js$', `${__dirname}/preprocessor-with-sourcemaps`, {}]], + transform: [['\\.js$', 'preprocessor-with-sourcemaps', {}]], }; const scriptTransformer = await createScriptTransformer(config); @@ -1006,9 +949,7 @@ describe('ScriptTransformer', () => { '//# sourceMappingURL=data:application/json;base64,' + Buffer.from(sourceMap).toString('base64').slice(0, 16); - require(`${__dirname}/preprocessor-with-sourcemaps`).process.mockReturnValue( - content, - ); + require('preprocessor-with-sourcemaps').process.mockReturnValue(content); const result = await scriptTransformer.transformAsync( '/fruits/banana.js', @@ -1018,14 +959,7 @@ describe('ScriptTransformer', () => { expect(writeFileAtomic.sync).toBeCalledTimes(1); expect(console.warn).toHaveBeenCalledTimes(1); - expect( - wrap( - console.warn.mock.calls[0][0].replace( - new RegExp(__dirname, 'g'), - '', - ), - ), - ).toMatchSnapshot(); + expect(wrap(console.warn.mock.calls[0][0])).toMatchSnapshot(); console.warn = warn; }); @@ -1035,9 +969,7 @@ describe('ScriptTransformer', () => { config = { ...config, - transform: [ - ['\\.js$', `${__dirname}/async-preprocessor-with-sourcemaps`, {}], - ], + transform: [['\\.js$', 'async-preprocessor-with-sourcemaps', {}]], }; const scriptTransformer = await createScriptTransformer(config); @@ -1052,7 +984,7 @@ describe('ScriptTransformer', () => { '//# sourceMappingURL=data:application/json;base64,' + Buffer.from(sourceMap).toString('base64').slice(0, 16); - require(`${__dirname}/async-preprocessor-with-sourcemaps`).processAsync.mockResolvedValue( + require('async-preprocessor-with-sourcemaps').processAsync.mockResolvedValue( content, ); @@ -1064,14 +996,7 @@ describe('ScriptTransformer', () => { expect(writeFileAtomic.sync).toBeCalledTimes(1); expect(console.warn).toHaveBeenCalledTimes(1); - expect( - wrap( - console.warn.mock.calls[0][0].replace( - new RegExp(__dirname, 'g'), - '', - ), - ), - ).toMatchSnapshot(); + expect(wrap(console.warn.mock.calls[0][0])).toMatchSnapshot(); console.warn = warn; }); @@ -1079,7 +1004,7 @@ describe('ScriptTransformer', () => { it('writes source maps if given by the transformer', async () => { config = { ...config, - transform: [['\\.js$', `${__dirname}/preprocessor-with-sourcemaps`, {}]], + transform: [['\\.js$', 'preprocessor-with-sourcemaps', {}]], }; const scriptTransformer = await createScriptTransformer(config); @@ -1088,12 +1013,10 @@ describe('ScriptTransformer', () => { version: 3, }; - require(`${__dirname}/preprocessor-with-sourcemaps`).process.mockReturnValue( - { - code: 'content', - map, - }, - ); + require('preprocessor-with-sourcemaps').process.mockReturnValue({ + code: 'content', + map, + }); const result = scriptTransformer.transform( '/fruits/banana.js', @@ -1114,16 +1037,14 @@ describe('ScriptTransformer', () => { it('does not write source map if not given by the transformer', async () => { config = { ...config, - transform: [['\\.js$', `${__dirname}/preprocessor-with-sourcemaps`, {}]], + transform: [['\\.js$', 'preprocessor-with-sourcemaps', {}]], }; const scriptTransformer = await createScriptTransformer(config); - require(`${__dirname}/preprocessor-with-sourcemaps`).process.mockReturnValue( - { - code: 'content', - map: null, - }, - ); + require('preprocessor-with-sourcemaps').process.mockReturnValue({ + code: 'content', + map: null, + }); const result = scriptTransformer.transform( '/fruits/banana.js', @@ -1136,16 +1057,14 @@ describe('ScriptTransformer', () => { it('in async mode, does not write source map if not given by the transformer', async () => { config = { ...config, - transform: [['\\.js$', `${__dirname}/preprocessor-with-sourcemaps`, {}]], + transform: [['\\.js$', 'preprocessor-with-sourcemaps', {}]], }; const scriptTransformer = await createScriptTransformer(config); - require(`${__dirname}/preprocessor-with-sourcemaps`).process.mockReturnValue( - { - code: 'content', - map: null, - }, - ); + require('preprocessor-with-sourcemaps').process.mockReturnValue({ + code: 'content', + map: null, + }); const result = await scriptTransformer.transformAsync( '/fruits/banana.js', @@ -1158,13 +1077,11 @@ describe('ScriptTransformer', () => { it('does not write source map if not given by the async preprocessor', async () => { config = { ...config, - transform: [ - ['\\.js$', `${__dirname}/async-preprocessor-with-sourcemaps`, {}], - ], + transform: [['\\.js$', 'async-preprocessor-with-sourcemaps', {}]], }; const scriptTransformer = await createScriptTransformer(config); - require(`${__dirname}/async-preprocessor-with-sourcemaps`).processAsync.mockResolvedValue( + require('async-preprocessor-with-sourcemaps').processAsync.mockResolvedValue( { code: 'content', map: null, @@ -1182,7 +1099,7 @@ describe('ScriptTransformer', () => { it('should write a source map for the instrumented file when transformed', async () => { const transformerConfig: Config.ProjectConfig = { ...config, - transform: [['\\.js$', `${__dirname}/preprocessor-with-sourcemaps`, {}]], + transform: [['\\.js$', 'preprocessor-with-sourcemaps', {}]], }; const scriptTransformer = await createScriptTransformer(transformerConfig); @@ -1203,12 +1120,10 @@ describe('ScriptTransformer', () => { }; /* eslint-enable */ - require(`${__dirname}/preprocessor-with-sourcemaps`).process.mockReturnValue( - { - code: 'content', - map, - }, - ); + require('preprocessor-with-sourcemaps').process.mockReturnValue({ + code: 'content', + map, + }); const result = scriptTransformer.transform( '/fruits/banana.js', @@ -1229,7 +1144,7 @@ describe('ScriptTransformer', () => { it('in async mode, should write a source map for the instrumented file when transformed', async () => { const transformerConfig: Config.ProjectConfig = { ...config, - transform: [['\\.js$', `${__dirname}/preprocessor-with-sourcemaps`, {}]], + transform: [['\\.js$', 'preprocessor-with-sourcemaps', {}]], }; const scriptTransformer = await createScriptTransformer(transformerConfig); @@ -1250,12 +1165,10 @@ describe('ScriptTransformer', () => { }; /* eslint-enable */ - require(`${__dirname}/preprocessor-with-sourcemaps`).process.mockReturnValue( - { - code: 'content', - map, - }, - ); + require('preprocessor-with-sourcemaps').process.mockReturnValue({ + code: 'content', + map, + }); const result = await scriptTransformer.transformAsync( '/fruits/banana.js', @@ -1276,9 +1189,7 @@ describe('ScriptTransformer', () => { it('should write a source map for the instrumented file when async transformed', async () => { const transformerConfig: Config.ProjectConfig = { ...config, - transform: [ - ['\\.js$', `${__dirname}/async-preprocessor-with-sourcemaps`, {}], - ], + transform: [['\\.js$', 'async-preprocessor-with-sourcemaps', {}]], }; const scriptTransformer = await createScriptTransformer(transformerConfig); @@ -1299,7 +1210,7 @@ describe('ScriptTransformer', () => { }; /* eslint-enable */ - require(`${__dirname}/async-preprocessor-with-sourcemaps`).processAsync.mockResolvedValue( + require('async-preprocessor-with-sourcemaps').processAsync.mockResolvedValue( { code: 'content', map, @@ -1337,12 +1248,10 @@ describe('ScriptTransformer', () => { }; /* eslint-enable */ - require(`${__dirname}/preprocessor-with-sourcemaps`).process.mockReturnValue( - { - code: 'content', - map: null, - }, - ); + require('preprocessor-with-sourcemaps').process.mockReturnValue({ + code: 'content', + map: null, + }); const result = scriptTransformer.transform( '/fruits/banana.js', @@ -1375,12 +1284,10 @@ describe('ScriptTransformer', () => { }; /* eslint-enable */ - require(`${__dirname}/preprocessor-with-sourcemaps`).process.mockReturnValue( - { - code: 'content', - map: null, - }, - ); + require('preprocessor-with-sourcemaps').process.mockReturnValue({ + code: 'content', + map: null, + }); const result = await scriptTransformer.transformAsync( '/fruits/banana.js', @@ -1413,7 +1320,7 @@ describe('ScriptTransformer', () => { }; /* eslint-enable */ - require(`${__dirname}/async-preprocessor-with-sourcemaps`).processAsync.mockResolvedValue( + require('async-preprocessor-with-sourcemaps').processAsync.mockResolvedValue( { code: 'content', map: null, @@ -1439,13 +1346,7 @@ describe('ScriptTransformer', () => { it('passes expected transform options to getCacheKey', async () => { config = { ...config, - transform: [ - [ - '\\.js$', - `${__dirname}/test_preprocessor`, - {configKey: 'configValue'}, - ], - ], + transform: [['\\.js$', 'test_preprocessor', {configKey: 'configValue'}]], }; const scriptTransformer = await createScriptTransformer(config); @@ -1454,20 +1355,14 @@ describe('ScriptTransformer', () => { getCoverageOptions({collectCoverage: true}), ); - const {getCacheKey} = require(`${__dirname}/test_preprocessor`); + const {getCacheKey} = require('test_preprocessor'); expect(getCacheKey).toMatchSnapshot(); }); it('in async mode, passes expected transform options to getCacheKey', async () => { config = { ...config, - transform: [ - [ - '\\.js$', - `${__dirname}/test_preprocessor`, - {configKey: 'configValue'}, - ], - ], + transform: [['\\.js$', 'test_preprocessor', {configKey: 'configValue'}]], }; const scriptTransformer = await createScriptTransformer(config); @@ -1476,7 +1371,7 @@ describe('ScriptTransformer', () => { getCoverageOptions({collectCoverage: true}), ); - const {getCacheKey} = require(`${__dirname}/test_preprocessor`); + const {getCacheKey} = require('test_preprocessor'); expect(getCacheKey).toMatchSnapshot(); }); @@ -1484,11 +1379,7 @@ describe('ScriptTransformer', () => { config = { ...config, transform: [ - [ - '\\.js$', - `${__dirname}/test_async_preprocessor`, - {configKey: 'configValue'}, - ], + ['\\.js$', 'test_async_preprocessor', {configKey: 'configValue'}], ], }; const scriptTransformer = await createScriptTransformer(config); @@ -1498,33 +1389,27 @@ describe('ScriptTransformer', () => { getCoverageOptions({collectCoverage: true}), ); - const {getCacheKeyAsync} = require(`${__dirname}/test_async_preprocessor`); + const {getCacheKeyAsync} = require('test_async_preprocessor'); expect(getCacheKeyAsync).toMatchSnapshot(); }); it('creates transformer with config', async () => { const transformerConfig = {}; config = Object.assign(config, { - transform: [ - [ - '\\.js$', - `${__dirname}/configureable-preprocessor`, - transformerConfig, - ], - ], + transform: [['\\.js$', 'configureable-preprocessor', transformerConfig]], }); const scriptTransformer = await createScriptTransformer(config); scriptTransformer.transform('/fruits/banana.js', {}); expect( - require(`${__dirname}/configureable-preprocessor`).createTransformer, + require('configureable-preprocessor').createTransformer, ).toHaveBeenCalledWith(transformerConfig); }); it('reads values from the cache', async () => { const transformConfig: Config.ProjectConfig = { ...config, - transform: [['\\.js$', `${__dirname}/test_preprocessor`, {}]], + transform: [['\\.js$', 'test_preprocessor', {}]], }; let scriptTransformer = await createScriptTransformer(transformConfig); scriptTransformer.transform('/fruits/banana.js', getCoverageOptions()); @@ -1565,7 +1450,7 @@ describe('ScriptTransformer', () => { it('in async mode, reads values from the cache', async () => { const transformConfig: Config.ProjectConfig = { ...config, - transform: [['\\.js$', `${__dirname}/test_preprocessor`, {}]], + transform: [['\\.js$', 'test_preprocessor', {}]], }; let scriptTransformer = await createScriptTransformer(transformConfig); await scriptTransformer.transformAsync( @@ -1615,7 +1500,7 @@ describe('ScriptTransformer', () => { it('reads values from the cache when using async preprocessor', async () => { const transformConfig: Config.ProjectConfig = { ...config, - transform: [['\\.js$', `${__dirname}/test_async_preprocessor`, {}]], + transform: [['\\.js$', 'test_async_preprocessor', {}]], }; let scriptTransformer = await createScriptTransformer(transformConfig); await scriptTransformer.transformAsync( @@ -1665,7 +1550,7 @@ describe('ScriptTransformer', () => { it('reads values from the cache when the file contains colons', async () => { const transformConfig: Config.ProjectConfig = { ...config, - transform: [['\\.js$', `${__dirname}/test_preprocessor`, {}]], + transform: [['\\.js$', 'test_preprocessor', {}]], }; let scriptTransformer = await createScriptTransformer(transformConfig); scriptTransformer.transform( @@ -1696,7 +1581,7 @@ describe('ScriptTransformer', () => { it('in async mode, reads values from the cache when the file contains colons', async () => { const transformConfig: Config.ProjectConfig = { ...config, - transform: [['\\.js$', `${__dirname}/test_preprocessor`, {}]], + transform: [['\\.js$', 'test_preprocessor', {}]], }; let scriptTransformer = await createScriptTransformer(transformConfig); await scriptTransformer.transformAsync( @@ -1727,7 +1612,7 @@ describe('ScriptTransformer', () => { it('with async preprocessor, reads values from the cache when the file contains colons', async () => { const transformConfig: Config.ProjectConfig = { ...config, - transform: [['\\.js$', `${__dirname}/test_async_preprocessor`, {}]], + transform: [['\\.js$', 'test_async_preprocessor', {}]], }; let scriptTransformer = await createScriptTransformer(transformConfig); await scriptTransformer.transformAsync( @@ -1757,11 +1642,11 @@ describe('ScriptTransformer', () => { it('should reuse the value from in-memory cache which is set by custom transformer', async () => { const cacheFS = new Map(); - const testPreprocessor = require(`${__dirname}/cache_fs_preprocessor`); + const testPreprocessor = require('cache_fs_preprocessor'); const scriptTransformer = await createScriptTransformer( { ...config, - transform: [['\\.js$', `${__dirname}/cache_fs_preprocessor`, {}]], + transform: [['\\.js$', 'cache_fs_preprocessor', {}]], }, cacheFS, ); @@ -1782,11 +1667,11 @@ describe('ScriptTransformer', () => { it('in async mode, should reuse the value from in-memory cache which is set by custom preprocessor', async () => { const cacheFS = new Map(); - const testPreprocessor = require(`${__dirname}/cache_fs_preprocessor`); + const testPreprocessor = require('cache_fs_preprocessor'); const scriptTransformer = await createScriptTransformer( { ...config, - transform: [['\\.js$', `${__dirname}/cache_fs_preprocessor`, {}]], + transform: [['\\.js$', 'cache_fs_preprocessor', {}]], }, cacheFS, ); @@ -1807,11 +1692,11 @@ describe('ScriptTransformer', () => { it('should reuse the value from in-memory cache which is set by custom async preprocessor', async () => { const cacheFS = new Map(); - const testPreprocessor = require(`${__dirname}/cache_fs_async_preprocessor`); + const testPreprocessor = require('cache_fs_async_preprocessor'); const scriptTransformer = await createScriptTransformer( { ...config, - transform: [['\\.js$', `${__dirname}/cache_fs_async_preprocessor`, {}]], + transform: [['\\.js$', 'cache_fs_async_preprocessor', {}]], }, cacheFS, ); @@ -1837,14 +1722,14 @@ describe('ScriptTransformer', () => { it('does not reuse the in-memory cache between different projects', async () => { const scriptTransformer = await createScriptTransformer({ ...config, - transform: [['\\.js$', `${__dirname}/test_preprocessor`, {}]], + transform: [['\\.js$', 'test_preprocessor', {}]], }); scriptTransformer.transform('/fruits/banana.js', getCoverageOptions()); const anotherScriptTransformer = await createScriptTransformer({ ...config, - transform: [['\\.js$', `${__dirname}/css-preprocessor`, {}]], + transform: [['\\.js$', 'css-preprocessor', {}]], }); anotherScriptTransformer.transform( @@ -1859,7 +1744,7 @@ describe('ScriptTransformer', () => { it('async mode does not reuse the in-memory cache between different projects', async () => { const scriptTransformer = await createScriptTransformer({ ...config, - transform: [['\\.js$', `${__dirname}/test_preprocessor`, {}]], + transform: [['\\.js$', 'test_preprocessor', {}]], }); await scriptTransformer.transformAsync( @@ -1869,7 +1754,7 @@ describe('ScriptTransformer', () => { const anotherScriptTransformer = await createScriptTransformer({ ...config, - transform: [['\\.js$', `${__dirname}/css-preprocessor`, {}]], + transform: [['\\.js$', 'css-preprocessor', {}]], }); await anotherScriptTransformer.transformAsync( @@ -1884,14 +1769,14 @@ describe('ScriptTransformer', () => { it('regardless of sync/async, does not reuse the in-memory cache between different projects', async () => { const scriptTransformer = await createScriptTransformer({ ...config, - transform: [['\\.js$', `${__dirname}/test_preprocessor`, {}]], + transform: [['\\.js$', 'test_preprocessor', {}]], }); scriptTransformer.transform('/fruits/banana.js', getCoverageOptions()); const anotherScriptTransformer = await createScriptTransformer({ ...config, - transform: [['\\.js$', `${__dirname}/css-preprocessor`, {}]], + transform: [['\\.js$', 'css-preprocessor', {}]], }); await anotherScriptTransformer.transformAsync( @@ -1901,7 +1786,7 @@ describe('ScriptTransformer', () => { const yetAnotherScriptTransformer = await createScriptTransformer({ ...config, - transform: [['\\.js$', `${__dirname}/test_preprocessor`, {}]], + transform: [['\\.js$', 'test_preprocessor', {}]], }); yetAnotherScriptTransformer.transform( '/fruits/banana.js', @@ -1910,7 +1795,7 @@ describe('ScriptTransformer', () => { const fruityScriptTransformer = await createScriptTransformer({ ...config, - transform: [['\\.js$', `${__dirname}/test_async_preprocessor`, {}]], + transform: [['\\.js$', 'test_async_preprocessor', {}]], }); await fruityScriptTransformer.transformAsync( '/fruits/banana.js', @@ -1924,11 +1809,11 @@ describe('ScriptTransformer', () => { it('preload transformer when using `createScriptTransformer`', async () => { const scriptTransformer = await createScriptTransformer({ ...config, - transform: [['\\.js$', `${__dirname}/test_preprocessor`, {}]], + transform: [['\\.js$', 'test_preprocessor', {}]], }); expect(Array.from(scriptTransformer._transformCache.entries())).toEqual([ - [`${__dirname}/test_preprocessor`, expect.any(Object)], + ['test_preprocessor', expect.any(Object)], ]); }); }); 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 e6e281cd5989..30afd6905c65 100644 --- a/packages/jest-transform/src/__tests__/__snapshots__/ScriptTransformer.test.ts.snap +++ b/packages/jest-transform/src/__tests__/__snapshots__/ScriptTransformer.test.ts.snap @@ -109,7 +109,7 @@ exports[`ScriptTransformer in async mode, uses the supplied async preprocessor 1 const TRANSFORMED = { filename: '/fruits/banana.js', script: 'module.exports = "banana";', - config: '{"collectCoverage":false,"collectCoverageFrom":[],"coverageProvider":"babel","supportsDynamicImport":false,"supportsExportNamespaceFrom":false,"supportsStaticESM":false,"supportsTopLevelAwait":false,"instrument":false,"cacheFS":{},"config":{"automock":false,"cache":true,"cacheDirectory":"/cache/","clearMocks":false,"coveragePathIgnorePatterns":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extensionsToTreatAsEsm":[],"extraGlobals":[],"forceCoverageMatch":[],"globals":{},"haste":{},"injectGlobals":true,"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleLoader":"/test_module_loader_path","moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"name":"test","prettierPath":"prettier","resetMocks":false,"resetModules":false,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"slowTestThreshold":5,"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-circus/runner","testURL":"http://localhost","timers":"real","transform":[["\\\\.js$","/test_async_preprocessor",{}]],"transformIgnorePatterns":["/node_modules/"],"watchPathIgnorePatterns":[]},"configString":"{\\"automock\\":false,\\"cache\\":true,\\"cacheDirectory\\":\\"/cache/\\",\\"clearMocks\\":false,\\"coveragePathIgnorePatterns\\":[],\\"cwd\\":\\"/test_root_dir/\\",\\"detectLeaks\\":false,\\"detectOpenHandles\\":false,\\"errorOnDeprecated\\":false,\\"extensionsToTreatAsEsm\\":[],\\"extraGlobals\\":[],\\"forceCoverageMatch\\":[],\\"globals\\":{},\\"haste\\":{},\\"injectGlobals\\":true,\\"moduleDirectories\\":[],\\"moduleFileExtensions\\":[\\"js\\"],\\"moduleLoader\\":\\"/test_module_loader_path\\",\\"moduleNameMapper\\":[],\\"modulePathIgnorePatterns\\":[],\\"modulePaths\\":[],\\"name\\":\\"test\\",\\"prettierPath\\":\\"prettier\\",\\"resetMocks\\":false,\\"resetModules\\":false,\\"restoreMocks\\":false,\\"rootDir\\":\\"/\\",\\"roots\\":[],\\"runner\\":\\"jest-runner\\",\\"setupFiles\\":[],\\"setupFilesAfterEnv\\":[],\\"skipFilter\\":false,\\"skipNodeResolution\\":false,\\"slowTestThreshold\\":5,\\"snapshotSerializers\\":[],\\"testEnvironment\\":\\"node\\",\\"testEnvironmentOptions\\":{},\\"testLocationInResults\\":false,\\"testMatch\\":[],\\"testPathIgnorePatterns\\":[],\\"testRegex\\":[\\"\\\\\\\\.test\\\\\\\\.js$\\"],\\"testRunner\\":\\"jest-circus/runner\\",\\"testURL\\":\\"http://localhost\\",\\"timers\\":\\"real\\",\\"transform\\":[[\\"\\\\\\\\.js$\\",\\"/test_async_preprocessor\\",{}]],\\"transformIgnorePatterns\\":[\\"/node_modules/\\"],\\"watchPathIgnorePatterns\\":[]}","transformerConfig":{}}', + config: '{"collectCoverage":false,"collectCoverageFrom":[],"coverageProvider":"babel","supportsDynamicImport":false,"supportsExportNamespaceFrom":false,"supportsStaticESM":false,"supportsTopLevelAwait":false,"instrument":false,"cacheFS":{},"config":{"automock":false,"cache":true,"cacheDirectory":"/cache/","clearMocks":false,"coveragePathIgnorePatterns":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extensionsToTreatAsEsm":[],"extraGlobals":[],"forceCoverageMatch":[],"globals":{},"haste":{},"injectGlobals":true,"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleLoader":"/test_module_loader_path","moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"name":"test","prettierPath":"prettier","resetMocks":false,"resetModules":false,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"slowTestThreshold":5,"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-circus/runner","testURL":"http://localhost","timers":"real","transform":[["\\\\.js$","test_async_preprocessor",{}]],"transformIgnorePatterns":["/node_modules/"],"watchPathIgnorePatterns":[]},"configString":"{\\"automock\\":false,\\"cache\\":true,\\"cacheDirectory\\":\\"/cache/\\",\\"clearMocks\\":false,\\"coveragePathIgnorePatterns\\":[],\\"cwd\\":\\"/test_root_dir/\\",\\"detectLeaks\\":false,\\"detectOpenHandles\\":false,\\"errorOnDeprecated\\":false,\\"extensionsToTreatAsEsm\\":[],\\"extraGlobals\\":[],\\"forceCoverageMatch\\":[],\\"globals\\":{},\\"haste\\":{},\\"injectGlobals\\":true,\\"moduleDirectories\\":[],\\"moduleFileExtensions\\":[\\"js\\"],\\"moduleLoader\\":\\"/test_module_loader_path\\",\\"moduleNameMapper\\":[],\\"modulePathIgnorePatterns\\":[],\\"modulePaths\\":[],\\"name\\":\\"test\\",\\"prettierPath\\":\\"prettier\\",\\"resetMocks\\":false,\\"resetModules\\":false,\\"restoreMocks\\":false,\\"rootDir\\":\\"/\\",\\"roots\\":[],\\"runner\\":\\"jest-runner\\",\\"setupFiles\\":[],\\"setupFilesAfterEnv\\":[],\\"skipFilter\\":false,\\"skipNodeResolution\\":false,\\"slowTestThreshold\\":5,\\"snapshotSerializers\\":[],\\"testEnvironment\\":\\"node\\",\\"testEnvironmentOptions\\":{},\\"testLocationInResults\\":false,\\"testMatch\\":[],\\"testPathIgnorePatterns\\":[],\\"testRegex\\":[\\"\\\\\\\\.test\\\\\\\\.js$\\"],\\"testRunner\\":\\"jest-circus/runner\\",\\"testURL\\":\\"http://localhost\\",\\"timers\\":\\"real\\",\\"transform\\":[[\\"\\\\\\\\.js$\\",\\"test_async_preprocessor\\",{}]],\\"transformIgnorePatterns\\":[\\"/node_modules/\\"],\\"watchPathIgnorePatterns\\":[]}","transformerConfig":{}}', }; `; @@ -119,13 +119,13 @@ exports[`ScriptTransformer in async mode, uses the supplied preprocessor 1`] = ` const TRANSFORMED = { filename: '/fruits/banana.js', script: 'module.exports = "banana";', - config: '{"collectCoverage":false,"collectCoverageFrom":[],"coverageProvider":"babel","supportsDynamicImport":false,"supportsExportNamespaceFrom":false,"supportsStaticESM":false,"supportsTopLevelAwait":false,"instrument":false,"cacheFS":{},"config":{"automock":false,"cache":true,"cacheDirectory":"/cache/","clearMocks":false,"coveragePathIgnorePatterns":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extensionsToTreatAsEsm":[],"extraGlobals":[],"forceCoverageMatch":[],"globals":{},"haste":{},"injectGlobals":true,"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleLoader":"/test_module_loader_path","moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"name":"test","prettierPath":"prettier","resetMocks":false,"resetModules":false,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"slowTestThreshold":5,"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-circus/runner","testURL":"http://localhost","timers":"real","transform":[["\\\\.js$","/test_preprocessor",{}]],"transformIgnorePatterns":["/node_modules/"],"watchPathIgnorePatterns":[]},"configString":"{\\"automock\\":false,\\"cache\\":true,\\"cacheDirectory\\":\\"/cache/\\",\\"clearMocks\\":false,\\"coveragePathIgnorePatterns\\":[],\\"cwd\\":\\"/test_root_dir/\\",\\"detectLeaks\\":false,\\"detectOpenHandles\\":false,\\"errorOnDeprecated\\":false,\\"extensionsToTreatAsEsm\\":[],\\"extraGlobals\\":[],\\"forceCoverageMatch\\":[],\\"globals\\":{},\\"haste\\":{},\\"injectGlobals\\":true,\\"moduleDirectories\\":[],\\"moduleFileExtensions\\":[\\"js\\"],\\"moduleLoader\\":\\"/test_module_loader_path\\",\\"moduleNameMapper\\":[],\\"modulePathIgnorePatterns\\":[],\\"modulePaths\\":[],\\"name\\":\\"test\\",\\"prettierPath\\":\\"prettier\\",\\"resetMocks\\":false,\\"resetModules\\":false,\\"restoreMocks\\":false,\\"rootDir\\":\\"/\\",\\"roots\\":[],\\"runner\\":\\"jest-runner\\",\\"setupFiles\\":[],\\"setupFilesAfterEnv\\":[],\\"skipFilter\\":false,\\"skipNodeResolution\\":false,\\"slowTestThreshold\\":5,\\"snapshotSerializers\\":[],\\"testEnvironment\\":\\"node\\",\\"testEnvironmentOptions\\":{},\\"testLocationInResults\\":false,\\"testMatch\\":[],\\"testPathIgnorePatterns\\":[],\\"testRegex\\":[\\"\\\\\\\\.test\\\\\\\\.js$\\"],\\"testRunner\\":\\"jest-circus/runner\\",\\"testURL\\":\\"http://localhost\\",\\"timers\\":\\"real\\",\\"transform\\":[[\\"\\\\\\\\.js$\\",\\"/test_preprocessor\\",{}]],\\"transformIgnorePatterns\\":[\\"/node_modules/\\"],\\"watchPathIgnorePatterns\\":[]}","transformerConfig":{}}', + config: '{"collectCoverage":false,"collectCoverageFrom":[],"coverageProvider":"babel","supportsDynamicImport":false,"supportsExportNamespaceFrom":false,"supportsStaticESM":false,"supportsTopLevelAwait":false,"instrument":false,"cacheFS":{},"config":{"automock":false,"cache":true,"cacheDirectory":"/cache/","clearMocks":false,"coveragePathIgnorePatterns":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extensionsToTreatAsEsm":[],"extraGlobals":[],"forceCoverageMatch":[],"globals":{},"haste":{},"injectGlobals":true,"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleLoader":"/test_module_loader_path","moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"name":"test","prettierPath":"prettier","resetMocks":false,"resetModules":false,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"slowTestThreshold":5,"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-circus/runner","testURL":"http://localhost","timers":"real","transform":[["\\\\.js$","test_preprocessor",{}]],"transformIgnorePatterns":["/node_modules/"],"watchPathIgnorePatterns":[]},"configString":"{\\"automock\\":false,\\"cache\\":true,\\"cacheDirectory\\":\\"/cache/\\",\\"clearMocks\\":false,\\"coveragePathIgnorePatterns\\":[],\\"cwd\\":\\"/test_root_dir/\\",\\"detectLeaks\\":false,\\"detectOpenHandles\\":false,\\"errorOnDeprecated\\":false,\\"extensionsToTreatAsEsm\\":[],\\"extraGlobals\\":[],\\"forceCoverageMatch\\":[],\\"globals\\":{},\\"haste\\":{},\\"injectGlobals\\":true,\\"moduleDirectories\\":[],\\"moduleFileExtensions\\":[\\"js\\"],\\"moduleLoader\\":\\"/test_module_loader_path\\",\\"moduleNameMapper\\":[],\\"modulePathIgnorePatterns\\":[],\\"modulePaths\\":[],\\"name\\":\\"test\\",\\"prettierPath\\":\\"prettier\\",\\"resetMocks\\":false,\\"resetModules\\":false,\\"restoreMocks\\":false,\\"rootDir\\":\\"/\\",\\"roots\\":[],\\"runner\\":\\"jest-runner\\",\\"setupFiles\\":[],\\"setupFilesAfterEnv\\":[],\\"skipFilter\\":false,\\"skipNodeResolution\\":false,\\"slowTestThreshold\\":5,\\"snapshotSerializers\\":[],\\"testEnvironment\\":\\"node\\",\\"testEnvironmentOptions\\":{},\\"testLocationInResults\\":false,\\"testMatch\\":[],\\"testPathIgnorePatterns\\":[],\\"testRegex\\":[\\"\\\\\\\\.test\\\\\\\\.js$\\"],\\"testRunner\\":\\"jest-circus/runner\\",\\"testURL\\":\\"http://localhost\\",\\"timers\\":\\"real\\",\\"transform\\":[[\\"\\\\\\\\.js$\\",\\"test_preprocessor\\",{}]],\\"transformIgnorePatterns\\":[\\"/node_modules/\\"],\\"watchPathIgnorePatterns\\":[]}","transformerConfig":{}}', }; `; exports[`ScriptTransformer in async mode, uses the supplied preprocessor 2`] = `module.exports = "react";`; -exports[`ScriptTransformer in async mode, warns of unparseable inlined source maps from the preprocessor 1`] = `jest-transform: The source map produced for the file /fruits/banana.js by /preprocessor-with-sourcemaps was invalid. Proceeding without source mapping for that file.`; +exports[`ScriptTransformer in async mode, warns of unparseable inlined source maps from the preprocessor 1`] = `jest-transform: The source map produced for the file /fruits/banana.js by preprocessor-with-sourcemaps was invalid. Proceeding without source mapping for that file.`; exports[`ScriptTransformer passes expected transform options to getCacheKey 1`] = ` [MockFunction] { @@ -645,7 +645,7 @@ exports[`ScriptTransformer uses mixture of sync/async preprocessors 1`] = ` const TRANSFORMED = { filename: '/fruits/banana.js', script: 'module.exports = "banana";', - config: '{"collectCoverage":false,"collectCoverageFrom":[],"coverageProvider":"babel","supportsDynamicImport":false,"supportsExportNamespaceFrom":false,"supportsStaticESM":false,"supportsTopLevelAwait":false,"instrument":false,"cacheFS":{},"config":{"automock":false,"cache":true,"cacheDirectory":"/cache/","clearMocks":false,"coveragePathIgnorePatterns":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extensionsToTreatAsEsm":[],"extraGlobals":[],"forceCoverageMatch":[],"globals":{},"haste":{},"injectGlobals":true,"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleLoader":"/test_module_loader_path","moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"name":"test","prettierPath":"prettier","resetMocks":false,"resetModules":false,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"slowTestThreshold":5,"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-circus/runner","testURL":"http://localhost","timers":"real","transform":[["\\\\.js$","/test_async_preprocessor",{}],["\\\\.css$","/css-preprocessor",{}]],"transformIgnorePatterns":["/node_modules/"],"watchPathIgnorePatterns":[]},"configString":"{\\"automock\\":false,\\"cache\\":true,\\"cacheDirectory\\":\\"/cache/\\",\\"clearMocks\\":false,\\"coveragePathIgnorePatterns\\":[],\\"cwd\\":\\"/test_root_dir/\\",\\"detectLeaks\\":false,\\"detectOpenHandles\\":false,\\"errorOnDeprecated\\":false,\\"extensionsToTreatAsEsm\\":[],\\"extraGlobals\\":[],\\"forceCoverageMatch\\":[],\\"globals\\":{},\\"haste\\":{},\\"injectGlobals\\":true,\\"moduleDirectories\\":[],\\"moduleFileExtensions\\":[\\"js\\"],\\"moduleLoader\\":\\"/test_module_loader_path\\",\\"moduleNameMapper\\":[],\\"modulePathIgnorePatterns\\":[],\\"modulePaths\\":[],\\"name\\":\\"test\\",\\"prettierPath\\":\\"prettier\\",\\"resetMocks\\":false,\\"resetModules\\":false,\\"restoreMocks\\":false,\\"rootDir\\":\\"/\\",\\"roots\\":[],\\"runner\\":\\"jest-runner\\",\\"setupFiles\\":[],\\"setupFilesAfterEnv\\":[],\\"skipFilter\\":false,\\"skipNodeResolution\\":false,\\"slowTestThreshold\\":5,\\"snapshotSerializers\\":[],\\"testEnvironment\\":\\"node\\",\\"testEnvironmentOptions\\":{},\\"testLocationInResults\\":false,\\"testMatch\\":[],\\"testPathIgnorePatterns\\":[],\\"testRegex\\":[\\"\\\\\\\\.test\\\\\\\\.js$\\"],\\"testRunner\\":\\"jest-circus/runner\\",\\"testURL\\":\\"http://localhost\\",\\"timers\\":\\"real\\",\\"transform\\":[[\\"\\\\\\\\.js$\\",\\"/test_async_preprocessor\\",{}],[\\"\\\\\\\\.css$\\",\\"/css-preprocessor\\",{}]],\\"transformIgnorePatterns\\":[\\"/node_modules/\\"],\\"watchPathIgnorePatterns\\":[]}","transformerConfig":{}}', + config: '{"collectCoverage":false,"collectCoverageFrom":[],"coverageProvider":"babel","supportsDynamicImport":false,"supportsExportNamespaceFrom":false,"supportsStaticESM":false,"supportsTopLevelAwait":false,"instrument":false,"cacheFS":{},"config":{"automock":false,"cache":true,"cacheDirectory":"/cache/","clearMocks":false,"coveragePathIgnorePatterns":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extensionsToTreatAsEsm":[],"extraGlobals":[],"forceCoverageMatch":[],"globals":{},"haste":{},"injectGlobals":true,"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleLoader":"/test_module_loader_path","moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"name":"test","prettierPath":"prettier","resetMocks":false,"resetModules":false,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"slowTestThreshold":5,"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-circus/runner","testURL":"http://localhost","timers":"real","transform":[["\\\\.js$","test_async_preprocessor",{}],["\\\\.css$","css-preprocessor",{}]],"transformIgnorePatterns":["/node_modules/"],"watchPathIgnorePatterns":[]},"configString":"{\\"automock\\":false,\\"cache\\":true,\\"cacheDirectory\\":\\"/cache/\\",\\"clearMocks\\":false,\\"coveragePathIgnorePatterns\\":[],\\"cwd\\":\\"/test_root_dir/\\",\\"detectLeaks\\":false,\\"detectOpenHandles\\":false,\\"errorOnDeprecated\\":false,\\"extensionsToTreatAsEsm\\":[],\\"extraGlobals\\":[],\\"forceCoverageMatch\\":[],\\"globals\\":{},\\"haste\\":{},\\"injectGlobals\\":true,\\"moduleDirectories\\":[],\\"moduleFileExtensions\\":[\\"js\\"],\\"moduleLoader\\":\\"/test_module_loader_path\\",\\"moduleNameMapper\\":[],\\"modulePathIgnorePatterns\\":[],\\"modulePaths\\":[],\\"name\\":\\"test\\",\\"prettierPath\\":\\"prettier\\",\\"resetMocks\\":false,\\"resetModules\\":false,\\"restoreMocks\\":false,\\"rootDir\\":\\"/\\",\\"roots\\":[],\\"runner\\":\\"jest-runner\\",\\"setupFiles\\":[],\\"setupFilesAfterEnv\\":[],\\"skipFilter\\":false,\\"skipNodeResolution\\":false,\\"slowTestThreshold\\":5,\\"snapshotSerializers\\":[],\\"testEnvironment\\":\\"node\\",\\"testEnvironmentOptions\\":{},\\"testLocationInResults\\":false,\\"testMatch\\":[],\\"testPathIgnorePatterns\\":[],\\"testRegex\\":[\\"\\\\\\\\.test\\\\\\\\.js$\\"],\\"testRunner\\":\\"jest-circus/runner\\",\\"testURL\\":\\"http://localhost\\",\\"timers\\":\\"real\\",\\"transform\\":[[\\"\\\\\\\\.js$\\",\\"test_async_preprocessor\\",{}],[\\"\\\\\\\\.css$\\",\\"css-preprocessor\\",{}]],\\"transformIgnorePatterns\\":[\\"/node_modules/\\"],\\"watchPathIgnorePatterns\\":[]}","transformerConfig":{}}', }; `; @@ -662,7 +662,7 @@ exports[`ScriptTransformer uses multiple preprocessors 1`] = ` const TRANSFORMED = { filename: '/fruits/banana.js', script: 'module.exports = "banana";', - config: '{"collectCoverage":false,"collectCoverageFrom":[],"coverageProvider":"babel","supportsDynamicImport":false,"supportsExportNamespaceFrom":false,"supportsStaticESM":false,"supportsTopLevelAwait":false,"instrument":false,"cacheFS":{},"config":{"automock":false,"cache":true,"cacheDirectory":"/cache/","clearMocks":false,"coveragePathIgnorePatterns":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extensionsToTreatAsEsm":[],"extraGlobals":[],"forceCoverageMatch":[],"globals":{},"haste":{},"injectGlobals":true,"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleLoader":"/test_module_loader_path","moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"name":"test","prettierPath":"prettier","resetMocks":false,"resetModules":false,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"slowTestThreshold":5,"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-circus/runner","testURL":"http://localhost","timers":"real","transform":[["\\\\.js$","/test_preprocessor",{}],["\\\\.css$","/css-preprocessor",{}]],"transformIgnorePatterns":["/node_modules/"],"watchPathIgnorePatterns":[]},"configString":"{\\"automock\\":false,\\"cache\\":true,\\"cacheDirectory\\":\\"/cache/\\",\\"clearMocks\\":false,\\"coveragePathIgnorePatterns\\":[],\\"cwd\\":\\"/test_root_dir/\\",\\"detectLeaks\\":false,\\"detectOpenHandles\\":false,\\"errorOnDeprecated\\":false,\\"extensionsToTreatAsEsm\\":[],\\"extraGlobals\\":[],\\"forceCoverageMatch\\":[],\\"globals\\":{},\\"haste\\":{},\\"injectGlobals\\":true,\\"moduleDirectories\\":[],\\"moduleFileExtensions\\":[\\"js\\"],\\"moduleLoader\\":\\"/test_module_loader_path\\",\\"moduleNameMapper\\":[],\\"modulePathIgnorePatterns\\":[],\\"modulePaths\\":[],\\"name\\":\\"test\\",\\"prettierPath\\":\\"prettier\\",\\"resetMocks\\":false,\\"resetModules\\":false,\\"restoreMocks\\":false,\\"rootDir\\":\\"/\\",\\"roots\\":[],\\"runner\\":\\"jest-runner\\",\\"setupFiles\\":[],\\"setupFilesAfterEnv\\":[],\\"skipFilter\\":false,\\"skipNodeResolution\\":false,\\"slowTestThreshold\\":5,\\"snapshotSerializers\\":[],\\"testEnvironment\\":\\"node\\",\\"testEnvironmentOptions\\":{},\\"testLocationInResults\\":false,\\"testMatch\\":[],\\"testPathIgnorePatterns\\":[],\\"testRegex\\":[\\"\\\\\\\\.test\\\\\\\\.js$\\"],\\"testRunner\\":\\"jest-circus/runner\\",\\"testURL\\":\\"http://localhost\\",\\"timers\\":\\"real\\",\\"transform\\":[[\\"\\\\\\\\.js$\\",\\"/test_preprocessor\\",{}],[\\"\\\\\\\\.css$\\",\\"/css-preprocessor\\",{}]],\\"transformIgnorePatterns\\":[\\"/node_modules/\\"],\\"watchPathIgnorePatterns\\":[]}","transformerConfig":{}}', + config: '{"collectCoverage":false,"collectCoverageFrom":[],"coverageProvider":"babel","supportsDynamicImport":false,"supportsExportNamespaceFrom":false,"supportsStaticESM":false,"supportsTopLevelAwait":false,"instrument":false,"cacheFS":{},"config":{"automock":false,"cache":true,"cacheDirectory":"/cache/","clearMocks":false,"coveragePathIgnorePatterns":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extensionsToTreatAsEsm":[],"extraGlobals":[],"forceCoverageMatch":[],"globals":{},"haste":{},"injectGlobals":true,"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleLoader":"/test_module_loader_path","moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"name":"test","prettierPath":"prettier","resetMocks":false,"resetModules":false,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"slowTestThreshold":5,"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-circus/runner","testURL":"http://localhost","timers":"real","transform":[["\\\\.js$","test_preprocessor",{}],["\\\\.css$","css-preprocessor",{}]],"transformIgnorePatterns":["/node_modules/"],"watchPathIgnorePatterns":[]},"configString":"{\\"automock\\":false,\\"cache\\":true,\\"cacheDirectory\\":\\"/cache/\\",\\"clearMocks\\":false,\\"coveragePathIgnorePatterns\\":[],\\"cwd\\":\\"/test_root_dir/\\",\\"detectLeaks\\":false,\\"detectOpenHandles\\":false,\\"errorOnDeprecated\\":false,\\"extensionsToTreatAsEsm\\":[],\\"extraGlobals\\":[],\\"forceCoverageMatch\\":[],\\"globals\\":{},\\"haste\\":{},\\"injectGlobals\\":true,\\"moduleDirectories\\":[],\\"moduleFileExtensions\\":[\\"js\\"],\\"moduleLoader\\":\\"/test_module_loader_path\\",\\"moduleNameMapper\\":[],\\"modulePathIgnorePatterns\\":[],\\"modulePaths\\":[],\\"name\\":\\"test\\",\\"prettierPath\\":\\"prettier\\",\\"resetMocks\\":false,\\"resetModules\\":false,\\"restoreMocks\\":false,\\"rootDir\\":\\"/\\",\\"roots\\":[],\\"runner\\":\\"jest-runner\\",\\"setupFiles\\":[],\\"setupFilesAfterEnv\\":[],\\"skipFilter\\":false,\\"skipNodeResolution\\":false,\\"slowTestThreshold\\":5,\\"snapshotSerializers\\":[],\\"testEnvironment\\":\\"node\\",\\"testEnvironmentOptions\\":{},\\"testLocationInResults\\":false,\\"testMatch\\":[],\\"testPathIgnorePatterns\\":[],\\"testRegex\\":[\\"\\\\\\\\.test\\\\\\\\.js$\\"],\\"testRunner\\":\\"jest-circus/runner\\",\\"testURL\\":\\"http://localhost\\",\\"timers\\":\\"real\\",\\"transform\\":[[\\"\\\\\\\\.js$\\",\\"test_preprocessor\\",{}],[\\"\\\\\\\\.css$\\",\\"css-preprocessor\\",{}]],\\"transformIgnorePatterns\\":[\\"/node_modules/\\"],\\"watchPathIgnorePatterns\\":[]}","transformerConfig":{}}', }; `; @@ -679,12 +679,12 @@ exports[`ScriptTransformer uses the supplied preprocessor 1`] = ` const TRANSFORMED = { filename: '/fruits/banana.js', script: 'module.exports = "banana";', - config: '{"collectCoverage":false,"collectCoverageFrom":[],"coverageProvider":"babel","supportsDynamicImport":false,"supportsExportNamespaceFrom":false,"supportsStaticESM":false,"supportsTopLevelAwait":false,"instrument":false,"cacheFS":{},"config":{"automock":false,"cache":true,"cacheDirectory":"/cache/","clearMocks":false,"coveragePathIgnorePatterns":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extensionsToTreatAsEsm":[],"extraGlobals":[],"forceCoverageMatch":[],"globals":{},"haste":{},"injectGlobals":true,"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleLoader":"/test_module_loader_path","moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"name":"test","prettierPath":"prettier","resetMocks":false,"resetModules":false,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"slowTestThreshold":5,"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-circus/runner","testURL":"http://localhost","timers":"real","transform":[["\\\\.js$","/test_preprocessor",{}]],"transformIgnorePatterns":["/node_modules/"],"watchPathIgnorePatterns":[]},"configString":"{\\"automock\\":false,\\"cache\\":true,\\"cacheDirectory\\":\\"/cache/\\",\\"clearMocks\\":false,\\"coveragePathIgnorePatterns\\":[],\\"cwd\\":\\"/test_root_dir/\\",\\"detectLeaks\\":false,\\"detectOpenHandles\\":false,\\"errorOnDeprecated\\":false,\\"extensionsToTreatAsEsm\\":[],\\"extraGlobals\\":[],\\"forceCoverageMatch\\":[],\\"globals\\":{},\\"haste\\":{},\\"injectGlobals\\":true,\\"moduleDirectories\\":[],\\"moduleFileExtensions\\":[\\"js\\"],\\"moduleLoader\\":\\"/test_module_loader_path\\",\\"moduleNameMapper\\":[],\\"modulePathIgnorePatterns\\":[],\\"modulePaths\\":[],\\"name\\":\\"test\\",\\"prettierPath\\":\\"prettier\\",\\"resetMocks\\":false,\\"resetModules\\":false,\\"restoreMocks\\":false,\\"rootDir\\":\\"/\\",\\"roots\\":[],\\"runner\\":\\"jest-runner\\",\\"setupFiles\\":[],\\"setupFilesAfterEnv\\":[],\\"skipFilter\\":false,\\"skipNodeResolution\\":false,\\"slowTestThreshold\\":5,\\"snapshotSerializers\\":[],\\"testEnvironment\\":\\"node\\",\\"testEnvironmentOptions\\":{},\\"testLocationInResults\\":false,\\"testMatch\\":[],\\"testPathIgnorePatterns\\":[],\\"testRegex\\":[\\"\\\\\\\\.test\\\\\\\\.js$\\"],\\"testRunner\\":\\"jest-circus/runner\\",\\"testURL\\":\\"http://localhost\\",\\"timers\\":\\"real\\",\\"transform\\":[[\\"\\\\\\\\.js$\\",\\"/test_preprocessor\\",{}]],\\"transformIgnorePatterns\\":[\\"/node_modules/\\"],\\"watchPathIgnorePatterns\\":[]}","transformerConfig":{}}', + config: '{"collectCoverage":false,"collectCoverageFrom":[],"coverageProvider":"babel","supportsDynamicImport":false,"supportsExportNamespaceFrom":false,"supportsStaticESM":false,"supportsTopLevelAwait":false,"instrument":false,"cacheFS":{},"config":{"automock":false,"cache":true,"cacheDirectory":"/cache/","clearMocks":false,"coveragePathIgnorePatterns":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extensionsToTreatAsEsm":[],"extraGlobals":[],"forceCoverageMatch":[],"globals":{},"haste":{},"injectGlobals":true,"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleLoader":"/test_module_loader_path","moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"name":"test","prettierPath":"prettier","resetMocks":false,"resetModules":false,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"slowTestThreshold":5,"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-circus/runner","testURL":"http://localhost","timers":"real","transform":[["\\\\.js$","test_preprocessor",{}]],"transformIgnorePatterns":["/node_modules/"],"watchPathIgnorePatterns":[]},"configString":"{\\"automock\\":false,\\"cache\\":true,\\"cacheDirectory\\":\\"/cache/\\",\\"clearMocks\\":false,\\"coveragePathIgnorePatterns\\":[],\\"cwd\\":\\"/test_root_dir/\\",\\"detectLeaks\\":false,\\"detectOpenHandles\\":false,\\"errorOnDeprecated\\":false,\\"extensionsToTreatAsEsm\\":[],\\"extraGlobals\\":[],\\"forceCoverageMatch\\":[],\\"globals\\":{},\\"haste\\":{},\\"injectGlobals\\":true,\\"moduleDirectories\\":[],\\"moduleFileExtensions\\":[\\"js\\"],\\"moduleLoader\\":\\"/test_module_loader_path\\",\\"moduleNameMapper\\":[],\\"modulePathIgnorePatterns\\":[],\\"modulePaths\\":[],\\"name\\":\\"test\\",\\"prettierPath\\":\\"prettier\\",\\"resetMocks\\":false,\\"resetModules\\":false,\\"restoreMocks\\":false,\\"rootDir\\":\\"/\\",\\"roots\\":[],\\"runner\\":\\"jest-runner\\",\\"setupFiles\\":[],\\"setupFilesAfterEnv\\":[],\\"skipFilter\\":false,\\"skipNodeResolution\\":false,\\"slowTestThreshold\\":5,\\"snapshotSerializers\\":[],\\"testEnvironment\\":\\"node\\",\\"testEnvironmentOptions\\":{},\\"testLocationInResults\\":false,\\"testMatch\\":[],\\"testPathIgnorePatterns\\":[],\\"testRegex\\":[\\"\\\\\\\\.test\\\\\\\\.js$\\"],\\"testRunner\\":\\"jest-circus/runner\\",\\"testURL\\":\\"http://localhost\\",\\"timers\\":\\"real\\",\\"transform\\":[[\\"\\\\\\\\.js$\\",\\"test_preprocessor\\",{}]],\\"transformIgnorePatterns\\":[\\"/node_modules/\\"],\\"watchPathIgnorePatterns\\":[]}","transformerConfig":{}}', }; `; exports[`ScriptTransformer uses the supplied preprocessor 2`] = `module.exports = "react";`; -exports[`ScriptTransformer warns of unparseable inlined source maps from the async preprocessor 1`] = `jest-transform: The source map produced for the file /fruits/banana.js by /async-preprocessor-with-sourcemaps was invalid. Proceeding without source mapping for that file.`; +exports[`ScriptTransformer warns of unparseable inlined source maps from the async preprocessor 1`] = `jest-transform: The source map produced for the file /fruits/banana.js by async-preprocessor-with-sourcemaps was invalid. Proceeding without source mapping for that file.`; -exports[`ScriptTransformer warns of unparseable inlined source maps from the preprocessor 1`] = `jest-transform: The source map produced for the file /fruits/banana.js by /preprocessor-with-sourcemaps was invalid. Proceeding without source mapping for that file.`; +exports[`ScriptTransformer warns of unparseable inlined source maps from the preprocessor 1`] = `jest-transform: The source map produced for the file /fruits/banana.js by preprocessor-with-sourcemaps was invalid. Proceeding without source mapping for that file.`;