feat: allow custom runner configuration options (tuple format) (#16141)

This commit is contained in:
Ahn
2026-05-08 09:13:38 +02:00
committed by GitHub
parent 52be4f8e55
commit 885f2e6dc0
22 changed files with 523 additions and 39 deletions
+4
View File
@@ -1,5 +1,9 @@
## main
### Features
- `[jest-config, jest-core, jest-runner, jest-schemas, jest-types]` Allow custom runner configuration options via tuple format `['runner-path', {options}]` ([#16141](https://github.com/jestjs/jest/pull/16141))
## 30.4.0
### Features
+71 -12
View File
@@ -1237,7 +1237,7 @@ export default defineConfig({
This example configuration will run Jest in the root directory as well as in every folder in the examples directory. You can have an unlimited amount of projects running in the same Jest instance.
The projects feature can also be used to run multiple configurations or multiple [runners](#runner-string). For this purpose, you can pass an array of configuration objects. For example, to run both tests and ESLint (via [jest-runner-eslint](https://github.com/jest-community/jest-runner-eslint)) in the same invocation of Jest:
The projects feature can also be used to run multiple configurations or multiple [runners](#runner-string--string-object). For this purpose, you can pass an array of configuration objects. For example, to run both tests and ESLint (via [jest-runner-eslint](https://github.com/jest-community/jest-runner-eslint)) in the same invocation of Jest:
```js tab title="jest.config.js"
const {defineConfig} = require('jest');
@@ -1654,7 +1654,7 @@ export default defineConfig({
});
```
### `runner` \[string]
### `runner` \[string | \[string, object\]]
Default: `"jest-runner"`
@@ -1671,17 +1671,76 @@ The `runner` property value can omit the `jest-runner-` prefix of the package na
:::
To write a test-runner, export a class with which accepts [`globalConfig`](https://github.com/jestjs/jest/blob/v29.2.1/packages/jest-types/src/Config.ts#L358-L422) in the constructor, and has a `runTests` method with the signature:
You can pass options to a custom runner by using a tuple form. The options will be passed as the third argument to the runner's constructor:
```ts
async function runTests(
tests: Array<Test>,
watcher: TestWatcher,
onStart: OnTestStart,
onResult: OnTestSuccess,
onFailure: OnTestFailure,
options: TestRunnerOptions,
): Promise<void>;
```js tab title="jest.config.js"
const {defineConfig} = require('jest');
module.exports = defineConfig({
runner: ['jest-runner-custom', {myOption: true, timeout: 5000}],
});
```
```ts tab title="jest.config.ts"
import {defineConfig} from 'jest';
export default defineConfig({
runner: ['jest-runner-custom', {myOption: true, timeout: 5000}],
});
```
To write a custom test-runner, export a class that extends one of the base runners from `jest-runner` (`CallbackTestRunner` or `EmittingTestRunner`) and implements the `runTests` method. When using the tuple configuration, the options object is passed as the third constructor argument:
```js tab title="my-runner.js"
const {CallbackTestRunner} = require('jest-runner');
class MyRunner extends CallbackTestRunner {
constructor(globalConfig, context, options) {
super(globalConfig, context);
this._runnerOptions = options;
}
async runTests(tests, watcher, onStart, onResult, onFailure, options) {
// implement test execution using this._runnerOptions
}
}
module.exports = MyRunner;
```
```ts tab title="my-runner.ts"
import type {Config} from '@jest/types';
import type {
CallbackTestRunner,
OnTestFailure,
OnTestStart,
OnTestSuccess,
Test,
TestRunnerContext,
TestRunnerOptions,
TestWatcher,
} from 'jest-runner';
export default class MyRunner extends CallbackTestRunner {
constructor(
globalConfig: Config.GlobalConfig,
context: TestRunnerContext,
private readonly _runnerOptions?: Record<string, unknown>,
) {
super(globalConfig, context);
}
async runTests(
tests: Array<Test>,
watcher: TestWatcher,
onStart: OnTestStart,
onResult: OnTestSuccess,
onFailure: OnTestFailure,
options: TestRunnerOptions,
): Promise<void> {
// implement test execution using this._runnerOptions
}
}
```
If you need to restrict your test-runner to only run in serial rather than being executed in parallel your class should have the property `isSerial` to be set as `true`.
@@ -66,6 +66,7 @@ exports[`--showConfig outputs config info and exits 1`] = `
"<<REPLACED_ROOT_DIR>>"
],
"runner": "<<REPLACED_JEST_PACKAGES_DIR>>/jest-runner/build/index.js",
"runnerOptions": {},
"sandboxInjectedGlobals": [],
"setupFiles": [],
"setupFilesAfterEnv": [],
+29
View File
@@ -0,0 +1,29 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import * as fs from 'graceful-fs';
import * as path from 'path';
import runJest from '../runJest';
const dir = path.resolve(__dirname, '../runner-options');
const optionsFile = path.join(dir, 'runner-options-received.json');
afterEach(() => {
if (fs.existsSync(optionsFile)) {
fs.unlinkSync(optionsFile);
}
});
describe('runner with options (tuple config)', () => {
it('passes options to the runner constructor', () => {
const result = runJest(dir);
expect(result.exitCode).toBe(0);
const receivedOptions = JSON.parse(fs.readFileSync(optionsFile, 'utf8'));
expect(receivedOptions).toEqual({count: 42, myOption: 'hello'});
});
});
@@ -0,0 +1,10 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
test('placeholder', () => {
expect(true).toBe(true);
});
+11
View File
@@ -0,0 +1,11 @@
{
"jest": {
"runner": [
"<rootDir>/runner.js",
{
"myOption": "hello",
"count": 42
}
]
}
}
+72
View File
@@ -0,0 +1,72 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const fs = require('node:fs');
const path = require('node:path');
class CustomRunner {
constructor(globalConfig, context, options) {
this._globalConfig = globalConfig;
this._context = context;
this._options = options;
// Write options to a file so the test can verify them
fs.writeFileSync(
path.join(__dirname, 'runner-options-received.json'),
JSON.stringify(options || null),
);
}
async runTests(tests, watcher, onStart, onResult, _onFailure) {
for (const test of tests) {
await onStart(test);
const result = {
console: null,
failureMessage: null,
leaks: false,
numFailingTests: 0,
numPassingTests: 1,
numPendingTests: 0,
numTodoTests: 0,
openHandles: [],
perfStats: {
end: Date.now(),
runtime: 0,
slow: false,
start: Date.now(),
},
skipped: false,
snapshot: {
added: 0,
fileDeleted: false,
matched: 0,
unchecked: 0,
uncheckedKeys: [],
unmatched: 0,
updated: 0,
},
testFilePath: test.path,
testResults: [
{
ancestorTitles: [],
duration: 1,
failureDetails: [],
failureMessages: [],
fullName: 'runner received options',
location: null,
numPassingAsserts: 1,
status: 'passed',
title: 'runner received options',
},
],
};
await onResult(test, result);
}
}
}
module.exports = CustomRunner;
+8 -2
View File
@@ -137,7 +137,10 @@ export const initialOptions: Config.InitialOptions = {
rootDir: '/',
roots: ['<rootDir>'],
runTestsByPath: false,
runner: 'jest-runner',
runner: multipleValidOptions('jest-runner', [
'jest-runner',
['jest-runner', {option: true}],
]) as unknown as string,
runtime: '<rootDir>',
sandboxInjectedGlobals: [],
setupFiles: ['<rootDir>/setup.js'],
@@ -299,7 +302,10 @@ export const initialProjectOptions: Config.InitialProjectOptions = {
restoreMocks: false,
rootDir: '/',
roots: ['<rootDir>'],
runner: 'jest-runner',
runner: multipleValidOptions('jest-runner', [
'jest-runner',
['jest-runner', {option: true}],
]) as unknown as string,
runtime: '<rootDir>',
sandboxInjectedGlobals: [],
setupFiles: ['<rootDir>/setup.js'],
@@ -1635,6 +1635,105 @@ describe('runner', () => {
),
).rejects.toThrowErrorMatchingSnapshot();
});
it('resolves runner from tuple config [path, options]', async () => {
const {options} = await normalize(
{
rootDir: '/root/',
runner: ['my-runner-foo', {workers: 4}],
},
{} as Config.Argv,
);
expect(options.runner).toBe('node_modules/my-runner-foo');
expect(options.runnerOptions).toEqual({workers: 4});
});
it('sets runnerOptions to empty object for string runner', async () => {
const {options} = await normalize(
{
rootDir: '/root/',
runner: 'my-runner-foo',
},
{} as Config.Argv,
);
expect(options.runner).toBe('node_modules/my-runner-foo');
expect(options.runnerOptions).toEqual({});
});
it('sets runnerOptions to empty object when tuple has no options', async () => {
const {options} = await normalize(
{
rootDir: '/root/',
runner: ['my-runner-foo', {}],
},
{} as Config.Argv,
);
expect(options.runner).toBe('node_modules/my-runner-foo');
expect(options.runnerOptions).toEqual({});
});
it('throws error when runner options is not a plain object', async () => {
await expect(
normalize(
{
rootDir: '/root/',
runner: ['my-runner-foo', 'invalid' as any],
},
{} as Config.Argv,
),
).rejects.toThrow('Runner options must be a plain object');
});
it('throws error when runner options is an array', async () => {
await expect(
normalize(
{
rootDir: '/root/',
runner: ['my-runner-foo', [] as any],
},
{} as Config.Argv,
),
).rejects.toThrow('Runner options must be a plain object');
});
it('throws error when runner tuple has empty string', async () => {
await expect(
normalize(
{
rootDir: '/root/',
runner: ['', {option: true}] as any,
},
{} as Config.Argv,
),
).rejects.toThrow('Runner must be a string or a tuple [string, object]');
});
it('throws error when runner tuple has non-string first element', async () => {
await expect(
normalize(
{
rootDir: '/root/',
runner: [123, {option: true}] as any,
},
{} as Config.Argv,
),
).rejects.toThrow('Runner must be a string or a tuple [string, object]');
});
it('throws error when runner options is a non-plain object', async () => {
await expect(
normalize(
{
rootDir: '/root/',
runner: ['my-runner-foo', new Date() as any],
},
{} as Config.Argv,
),
).rejects.toThrow('Runner options must be a plain object');
});
});
describe('watchPlugins', () => {
+1
View File
@@ -236,6 +236,7 @@ const groupOptions = (
rootDir: options.rootDir,
roots: options.roots,
runner: options.runner,
runnerOptions: options.runnerOptions,
runtime: options.runtime,
sandboxInjectedGlobals: options.sandboxInjectedGlobals,
setupFiles: options.setupFiles,
+40 -3
View File
@@ -705,10 +705,39 @@ export default async function normalize(
}
case 'runner': {
const option = oldOptions[key];
let runnerPath: string | undefined;
if (Array.isArray(option)) {
if (typeof option[0] !== 'string' || option[0].length === 0) {
throw createConfigError(
' Runner must be a string or a tuple [string, object].\n' +
' Configuration Documentation:\n' +
' https://jestjs.io/docs/configuration#runner-string--string-object',
);
}
runnerPath = option[0];
const runnerOptions = option[1];
if (
runnerOptions != null &&
(typeof runnerOptions !== 'object' ||
Array.isArray(runnerOptions) ||
Object.getPrototypeOf(runnerOptions) !== Object.prototype)
) {
throw createConfigError(
' Runner options must be a plain object.\n' +
' Configuration Documentation:\n' +
' https://jestjs.io/docs/configuration#runner-string--string-object',
);
}
newOptions.runnerOptions =
(runnerOptions as Record<string, unknown>) ?? {};
} else {
runnerPath = option;
newOptions.runnerOptions = {};
}
value =
option &&
runnerPath &&
resolveRunner(newOptions.resolver, {
filePath: option,
filePath: runnerPath,
requireResolveFunction: requireResolve,
rootDir: options.rootDir,
});
@@ -910,7 +939,11 @@ export default async function normalize(
value = oldOptions[key];
} else {
value = {
color: getDisplayNameColor(options.runner),
color: getDisplayNameColor(
Array.isArray(options.runner)
? options.runner[0]
: options.runner,
),
name: displayName,
};
}
@@ -1054,6 +1087,10 @@ export default async function normalize(
newOptions.runner = require.resolve(newOptions.runner);
}
if (newOptions.runnerOptions == null) {
newOptions.runnerOptions = {};
}
newOptions.nonFlagArgs = argv._?.map(arg => `${arg}`);
const testPathPatterns = buildTestPathPatterns(argv);
newOptions.testPathPatterns = testPathPatterns;
+1
View File
@@ -25,6 +25,7 @@
"chalk": "^4.1.2",
"ci-info": "^4.2.0",
"exit-x": "^0.2.2",
"fast-json-stable-stringify": "^2.1.0",
"graceful-fs": "^4.2.11",
"jest-changed-files": "workspace:*",
"jest-config": "workspace:*",
+29 -12
View File
@@ -8,6 +8,7 @@
import chalk from 'chalk';
import {GITHUB_ACTIONS} from 'ci-info';
import exit from 'exit-x';
import stableStringify from 'fast-json-stable-stringify';
import {
AgentReporter,
CoverageReporter,
@@ -76,6 +77,7 @@ export type ReporterConstructor = new (
type TestRunnerConstructor = new (
globalConfig: Config.GlobalConfig,
testRunnerContext: TestRunnerContext,
options?: Record<string, unknown>,
) => JestTestRunner;
export type TestSchedulerContext = ReporterContext & TestRunnerContext;
@@ -243,16 +245,21 @@ class TestScheduler {
await Promise.all(
[...testContexts].map(async context => {
const {config} = context;
if (!testRunners[config.runner]) {
const runnerKey = `${config.runner}\0${stableRunnerOptionsKey(config.runnerOptions)}`;
if (!testRunners[runnerKey]) {
const transformer = await createScriptTransformer(config);
const Runner: TestRunnerConstructor =
await transformer.requireAndTranspileModule(config.runner);
const runner = new Runner(this._globalConfig, {
changedFiles: this._context.changedFiles,
sourcesRelatedToTestsInChangedFiles:
this._context.sourcesRelatedToTestsInChangedFiles,
});
testRunners[config.runner] = runner;
const runner = new Runner(
this._globalConfig,
{
changedFiles: this._context.changedFiles,
sourcesRelatedToTestsInChangedFiles:
this._context.sourcesRelatedToTestsInChangedFiles,
},
config.runnerOptions,
);
testRunners[runnerKey] = runner;
contextsByTestRunner.set(runner, context);
}
}),
@@ -352,17 +359,20 @@ class TestScheduler {
): Record<string, Array<Test>> | null {
if (Object.keys(testRunners).length > 1) {
return tests.reduce((testRuns, test) => {
const runner = test.context.config.runner;
if (!testRuns[runner]) {
testRuns[runner] = [];
const {config} = test.context;
const runnerKey = `${config.runner}\0${stableRunnerOptionsKey(config.runnerOptions)}`;
if (!testRuns[runnerKey]) {
testRuns[runnerKey] = [];
}
testRuns[runner].push(test);
testRuns[runnerKey].push(test);
return testRuns;
}, Object.create(null));
} else if (tests.length > 0 && tests[0] != null) {
// If there is only one runner, don't partition the tests.
const {config} = tests[0].context;
const runnerKey = `${config.runner}\0${stableRunnerOptionsKey(config.runnerOptions)}`;
return Object.assign(Object.create(null), {
[tests[0].context.config.runner]: tests,
[runnerKey]: tests,
});
} else {
return null;
@@ -514,3 +524,10 @@ const buildExecError = (err: unknown): SerializableError => {
}
return strToError(JSON.stringify(err));
};
function stableRunnerOptionsKey(
options: Record<string, unknown> | undefined,
): string {
if (options == null || Object.keys(options).length === 0) return '{}';
return stableStringify(options);
}
@@ -618,3 +618,108 @@ test('should set runInBand to not run in serial', async () => {
expect(mockParallelRunner.runTests).toHaveBeenCalled();
expect(mockParallelRunner.runTests.mock.calls[0][5].serial).toBeFalsy();
});
test('passes runnerOptions as third argument to runner constructor', async () => {
const scheduler = await createTestScheduler(makeGlobalConfig(), {}, {});
const test = {
context: {
config: makeProjectConfig({
moduleFileExtensions: ['.js'],
runner: 'jest-runner-serial',
runnerOptions: {workers: 2},
transform: [],
}),
hasteFS: {
matchFiles: jest.fn(() => []),
},
},
path: './test/path.js',
};
await scheduler.scheduleTests([test], {isInterrupted: jest.fn()});
const RunnerConstructor = require('jest-runner-serial');
expect(RunnerConstructor).toHaveBeenCalledWith(
expect.anything(),
expect.anything(),
{workers: 2},
);
});
test('creates separate runner instances for same runner with different options', async () => {
const RunnerConstructor = require('jest-runner-serial');
RunnerConstructor.mockClear();
const scheduler = await createTestScheduler(makeGlobalConfig(), {}, {});
const context1 = {
config: makeProjectConfig({
moduleFileExtensions: ['.js'],
runner: 'jest-runner-serial',
runnerOptions: {mode: 'fast'},
transform: [],
}),
hasteFS: {
matchFiles: jest.fn(() => []),
},
};
const context2 = {
config: makeProjectConfig({
moduleFileExtensions: ['.js'],
runner: 'jest-runner-serial',
runnerOptions: {mode: 'slow'},
transform: [],
}),
hasteFS: {
matchFiles: jest.fn(() => []),
},
};
const test1 = {
context: context1,
path: './test/path1.js',
};
const test2 = {
context: context2,
path: './test/path2.js',
};
await scheduler.scheduleTests([test1, test2], {isInterrupted: jest.fn()});
expect(RunnerConstructor).toHaveBeenCalledTimes(2);
});
test('deduplicates runners with nested options in different key order', async () => {
const RunnerConstructor = require('jest-runner-serial');
RunnerConstructor.mockClear();
const scheduler = await createTestScheduler(makeGlobalConfig(), {}, {});
const sharedContext = {
config: makeProjectConfig({
moduleFileExtensions: ['.js'],
runner: 'jest-runner-serial',
runnerOptions: {list: [1, 2, 3], nested: {a: 1, b: 2}},
transform: [],
}),
hasteFS: {
matchFiles: jest.fn(() => []),
},
};
const test1 = {
context: sharedContext,
path: './test/path1.js',
};
const test2 = {
context: sharedContext,
path: './test/path2.js',
};
await scheduler.scheduleTests([test1, test2], {isInterrupted: jest.fn()});
// Same context = same runner, only instantiated once
expect(RunnerConstructor).toHaveBeenCalledTimes(1);
// Verify nested options were passed correctly
expect(RunnerConstructor).toHaveBeenCalledWith(
expect.anything(),
expect.anything(),
{list: [1, 2, 3], nested: {a: 1, b: 2}},
);
});
@@ -56,6 +56,7 @@ exports[`prints the config object 1`] = `
"path/to/dir/test"
],
"runner": "jest-runner",
"runnerOptions": {},
"runtime": "/test_module_loader_path",
"sandboxInjectedGlobals": [],
"setupFiles": [],
+1
View File
@@ -94,6 +94,7 @@ abstract class BaseTestRunner {
constructor(
protected readonly _globalConfig: Config.GlobalConfig,
protected readonly _context: TestRunnerContext,
protected readonly _options?: Record<string, unknown>,
) {}
}
+4 -1
View File
@@ -306,7 +306,10 @@ export const InitialOptions = Type.Partial(
restoreMocks: Type.Boolean(),
rootDir: Type.String(),
roots: Type.Array(Type.String()),
runner: Type.String(),
runner: Type.Union([
Type.String(),
Type.Tuple([Type.String(), Type.Record(Type.String(), Type.Unknown())]),
]),
runTestsByPath: Type.Boolean(),
runtime: Type.String(),
sandboxInjectedGlobals: Type.Array(Type.String()),
@@ -78,6 +78,7 @@ exports[`ScriptTransformer in async mode, passes expected transform options to g
"rootDir": "/",
"roots": Array [],
"runner": "jest-runner",
"runnerOptions": Object {},
"runtime": "/test_module_loader_path",
"sandboxInjectedGlobals": Array [],
"setupFiles": Array [],
@@ -114,7 +115,7 @@ exports[`ScriptTransformer in async mode, passes expected transform options to g
"waitForUnhandledRejections": false,
"watchPathIgnorePatterns": Array [],
},
"configString": "{"automock":false,"cache":true,"cacheDirectory":"/cache/","clearMocks":false,"collectCoverage":false,"collectCoverageFrom":["src","!public"],"coverageDirectory":"coverage","coveragePathIgnorePatterns":[],"coverageProvider":"babel","coverageReporters":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extensionsToTreatAsEsm":[],"fakeTimers":{"enableGlobally":false},"forceCoverageMatch":[],"globals":{},"haste":{},"id":"test","injectGlobals":true,"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"openHandlesTimeout":1000,"prettierPath":"prettier","reporters":["default","custom-reporter-1",["custom-reporter-2",{"configValue":true}]],"resetMocks":false,"resetModules":false,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","runtime":"/test_module_loader_path","sandboxInjectedGlobals":[],"setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"slowTestThreshold":5,"snapshotFormat":{},"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-circus/runner","testTimeout":5000,"transform":[["\\\\.js$","test_preprocessor",{"configKey":"configValue"}]],"transformIgnorePatterns":["/node_modules/"],"waitForUnhandledRejections":false,"watchPathIgnorePatterns":[]}",
"configString": "{"automock":false,"cache":true,"cacheDirectory":"/cache/","clearMocks":false,"collectCoverage":false,"collectCoverageFrom":["src","!public"],"coverageDirectory":"coverage","coveragePathIgnorePatterns":[],"coverageProvider":"babel","coverageReporters":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extensionsToTreatAsEsm":[],"fakeTimers":{"enableGlobally":false},"forceCoverageMatch":[],"globals":{},"haste":{},"id":"test","injectGlobals":true,"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"openHandlesTimeout":1000,"prettierPath":"prettier","reporters":["default","custom-reporter-1",["custom-reporter-2",{"configValue":true}]],"resetMocks":false,"resetModules":false,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","runnerOptions":{},"runtime":"/test_module_loader_path","sandboxInjectedGlobals":[],"setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"slowTestThreshold":5,"snapshotFormat":{},"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-circus/runner","testTimeout":5000,"transform":[["\\\\.js$","test_preprocessor",{"configKey":"configValue"}]],"transformIgnorePatterns":["/node_modules/"],"waitForUnhandledRejections":false,"watchPathIgnorePatterns":[]}",
"coverageProvider": "babel",
"instrument": true,
"supportsDynamicImport": false,
@@ -140,7 +141,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,"collectCoverage":false,"collectCoverageFrom":["src","!public"],"coverageDirectory":"coverage","coveragePathIgnorePatterns":[],"coverageProvider":"babel","coverageReporters":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extensionsToTreatAsEsm":[],"fakeTimers":{"enableGlobally":false},"forceCoverageMatch":[],"globals":{},"haste":{},"id":"test","injectGlobals":true,"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"openHandlesTimeout":1000,"prettierPath":"prettier","reporters":["default","custom-reporter-1",["custom-reporter-2",{"configValue":true}]],"resetMocks":false,"resetModules":false,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","runtime":"/test_module_loader_path","sandboxInjectedGlobals":[],"setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"slowTestThreshold":5,"snapshotFormat":{},"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-circus/runner","testTimeout":5000,"transform":[["\\\\.js$","test_async_preprocessor",{}]],"transformIgnorePatterns":["/node_modules/"],"waitForUnhandledRejections":false,"watchPathIgnorePatterns":[]},"configString":"{\\"automock\\":false,\\"cache\\":true,\\"cacheDirectory\\":\\"/cache/\\",\\"clearMocks\\":false,\\"collectCoverage\\":false,\\"collectCoverageFrom\\":[\\"src\\",\\"!public\\"],\\"coverageDirectory\\":\\"coverage\\",\\"coveragePathIgnorePatterns\\":[],\\"coverageProvider\\":\\"babel\\",\\"coverageReporters\\":[],\\"cwd\\":\\"/test_root_dir/\\",\\"detectLeaks\\":false,\\"detectOpenHandles\\":false,\\"errorOnDeprecated\\":false,\\"extensionsToTreatAsEsm\\":[],\\"fakeTimers\\":{\\"enableGlobally\\":false},\\"forceCoverageMatch\\":[],\\"globals\\":{},\\"haste\\":{},\\"id\\":\\"test\\",\\"injectGlobals\\":true,\\"moduleDirectories\\":[],\\"moduleFileExtensions\\":[\\"js\\"],\\"moduleNameMapper\\":[],\\"modulePathIgnorePatterns\\":[],\\"modulePaths\\":[],\\"openHandlesTimeout\\":1000,\\"prettierPath\\":\\"prettier\\",\\"reporters\\":[\\"default\\",\\"custom-reporter-1\\",[\\"custom-reporter-2\\",{\\"configValue\\":true}]],\\"resetMocks\\":false,\\"resetModules\\":false,\\"restoreMocks\\":false,\\"rootDir\\":\\"/\\",\\"roots\\":[],\\"runner\\":\\"jest-runner\\",\\"runtime\\":\\"/test_module_loader_path\\",\\"sandboxInjectedGlobals\\":[],\\"setupFiles\\":[],\\"setupFilesAfterEnv\\":[],\\"skipFilter\\":false,\\"skipNodeResolution\\":false,\\"slowTestThreshold\\":5,\\"snapshotFormat\\":{},\\"snapshotSerializers\\":[],\\"testEnvironment\\":\\"node\\",\\"testEnvironmentOptions\\":{},\\"testLocationInResults\\":false,\\"testMatch\\":[],\\"testPathIgnorePatterns\\":[],\\"testRegex\\":[\\"\\\\\\\\.test\\\\\\\\.js$\\"],\\"testRunner\\":\\"jest-circus/runner\\",\\"testTimeout\\":5000,\\"transform\\":[[\\"\\\\\\\\.js$\\",\\"test_async_preprocessor\\",{}]],\\"transformIgnorePatterns\\":[\\"/node_modules/\\"],\\"waitForUnhandledRejections\\":false,\\"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,"collectCoverage":false,"collectCoverageFrom":["src","!public"],"coverageDirectory":"coverage","coveragePathIgnorePatterns":[],"coverageProvider":"babel","coverageReporters":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extensionsToTreatAsEsm":[],"fakeTimers":{"enableGlobally":false},"forceCoverageMatch":[],"globals":{},"haste":{},"id":"test","injectGlobals":true,"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"openHandlesTimeout":1000,"prettierPath":"prettier","reporters":["default","custom-reporter-1",["custom-reporter-2",{"configValue":true}]],"resetMocks":false,"resetModules":false,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","runnerOptions":{},"runtime":"/test_module_loader_path","sandboxInjectedGlobals":[],"setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"slowTestThreshold":5,"snapshotFormat":{},"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-circus/runner","testTimeout":5000,"transform":[["\\\\.js$","test_async_preprocessor",{}]],"transformIgnorePatterns":["/node_modules/"],"waitForUnhandledRejections":false,"watchPathIgnorePatterns":[]},"configString":"{\\"automock\\":false,\\"cache\\":true,\\"cacheDirectory\\":\\"/cache/\\",\\"clearMocks\\":false,\\"collectCoverage\\":false,\\"collectCoverageFrom\\":[\\"src\\",\\"!public\\"],\\"coverageDirectory\\":\\"coverage\\",\\"coveragePathIgnorePatterns\\":[],\\"coverageProvider\\":\\"babel\\",\\"coverageReporters\\":[],\\"cwd\\":\\"/test_root_dir/\\",\\"detectLeaks\\":false,\\"detectOpenHandles\\":false,\\"errorOnDeprecated\\":false,\\"extensionsToTreatAsEsm\\":[],\\"fakeTimers\\":{\\"enableGlobally\\":false},\\"forceCoverageMatch\\":[],\\"globals\\":{},\\"haste\\":{},\\"id\\":\\"test\\",\\"injectGlobals\\":true,\\"moduleDirectories\\":[],\\"moduleFileExtensions\\":[\\"js\\"],\\"moduleNameMapper\\":[],\\"modulePathIgnorePatterns\\":[],\\"modulePaths\\":[],\\"openHandlesTimeout\\":1000,\\"prettierPath\\":\\"prettier\\",\\"reporters\\":[\\"default\\",\\"custom-reporter-1\\",[\\"custom-reporter-2\\",{\\"configValue\\":true}]],\\"resetMocks\\":false,\\"resetModules\\":false,\\"restoreMocks\\":false,\\"rootDir\\":\\"/\\",\\"roots\\":[],\\"runner\\":\\"jest-runner\\",\\"runnerOptions\\":{},\\"runtime\\":\\"/test_module_loader_path\\",\\"sandboxInjectedGlobals\\":[],\\"setupFiles\\":[],\\"setupFilesAfterEnv\\":[],\\"skipFilter\\":false,\\"skipNodeResolution\\":false,\\"slowTestThreshold\\":5,\\"snapshotFormat\\":{},\\"snapshotSerializers\\":[],\\"testEnvironment\\":\\"node\\",\\"testEnvironmentOptions\\":{},\\"testLocationInResults\\":false,\\"testMatch\\":[],\\"testPathIgnorePatterns\\":[],\\"testRegex\\":[\\"\\\\\\\\.test\\\\\\\\.js$\\"],\\"testRunner\\":\\"jest-circus/runner\\",\\"testTimeout\\":5000,\\"transform\\":[[\\"\\\\\\\\.js$\\",\\"test_async_preprocessor\\",{}]],\\"transformIgnorePatterns\\":[\\"/node_modules/\\"],\\"waitForUnhandledRejections\\":false,\\"watchPathIgnorePatterns\\":[]}","transformerConfig":{}}',
};"
`;
@@ -150,7 +151,7 @@ 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,"collectCoverage":false,"collectCoverageFrom":["src","!public"],"coverageDirectory":"coverage","coveragePathIgnorePatterns":[],"coverageProvider":"babel","coverageReporters":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extensionsToTreatAsEsm":[],"fakeTimers":{"enableGlobally":false},"forceCoverageMatch":[],"globals":{},"haste":{},"id":"test","injectGlobals":true,"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"openHandlesTimeout":1000,"prettierPath":"prettier","reporters":["default","custom-reporter-1",["custom-reporter-2",{"configValue":true}]],"resetMocks":false,"resetModules":false,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","runtime":"/test_module_loader_path","sandboxInjectedGlobals":[],"setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"slowTestThreshold":5,"snapshotFormat":{},"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-circus/runner","testTimeout":5000,"transform":[["\\\\.js$","test_preprocessor",{}]],"transformIgnorePatterns":["/node_modules/"],"waitForUnhandledRejections":false,"watchPathIgnorePatterns":[]},"configString":"{\\"automock\\":false,\\"cache\\":true,\\"cacheDirectory\\":\\"/cache/\\",\\"clearMocks\\":false,\\"collectCoverage\\":false,\\"collectCoverageFrom\\":[\\"src\\",\\"!public\\"],\\"coverageDirectory\\":\\"coverage\\",\\"coveragePathIgnorePatterns\\":[],\\"coverageProvider\\":\\"babel\\",\\"coverageReporters\\":[],\\"cwd\\":\\"/test_root_dir/\\",\\"detectLeaks\\":false,\\"detectOpenHandles\\":false,\\"errorOnDeprecated\\":false,\\"extensionsToTreatAsEsm\\":[],\\"fakeTimers\\":{\\"enableGlobally\\":false},\\"forceCoverageMatch\\":[],\\"globals\\":{},\\"haste\\":{},\\"id\\":\\"test\\",\\"injectGlobals\\":true,\\"moduleDirectories\\":[],\\"moduleFileExtensions\\":[\\"js\\"],\\"moduleNameMapper\\":[],\\"modulePathIgnorePatterns\\":[],\\"modulePaths\\":[],\\"openHandlesTimeout\\":1000,\\"prettierPath\\":\\"prettier\\",\\"reporters\\":[\\"default\\",\\"custom-reporter-1\\",[\\"custom-reporter-2\\",{\\"configValue\\":true}]],\\"resetMocks\\":false,\\"resetModules\\":false,\\"restoreMocks\\":false,\\"rootDir\\":\\"/\\",\\"roots\\":[],\\"runner\\":\\"jest-runner\\",\\"runtime\\":\\"/test_module_loader_path\\",\\"sandboxInjectedGlobals\\":[],\\"setupFiles\\":[],\\"setupFilesAfterEnv\\":[],\\"skipFilter\\":false,\\"skipNodeResolution\\":false,\\"slowTestThreshold\\":5,\\"snapshotFormat\\":{},\\"snapshotSerializers\\":[],\\"testEnvironment\\":\\"node\\",\\"testEnvironmentOptions\\":{},\\"testLocationInResults\\":false,\\"testMatch\\":[],\\"testPathIgnorePatterns\\":[],\\"testRegex\\":[\\"\\\\\\\\.test\\\\\\\\.js$\\"],\\"testRunner\\":\\"jest-circus/runner\\",\\"testTimeout\\":5000,\\"transform\\":[[\\"\\\\\\\\.js$\\",\\"test_preprocessor\\",{}]],\\"transformIgnorePatterns\\":[\\"/node_modules/\\"],\\"waitForUnhandledRejections\\":false,\\"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,"collectCoverage":false,"collectCoverageFrom":["src","!public"],"coverageDirectory":"coverage","coveragePathIgnorePatterns":[],"coverageProvider":"babel","coverageReporters":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extensionsToTreatAsEsm":[],"fakeTimers":{"enableGlobally":false},"forceCoverageMatch":[],"globals":{},"haste":{},"id":"test","injectGlobals":true,"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"openHandlesTimeout":1000,"prettierPath":"prettier","reporters":["default","custom-reporter-1",["custom-reporter-2",{"configValue":true}]],"resetMocks":false,"resetModules":false,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","runnerOptions":{},"runtime":"/test_module_loader_path","sandboxInjectedGlobals":[],"setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"slowTestThreshold":5,"snapshotFormat":{},"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-circus/runner","testTimeout":5000,"transform":[["\\\\.js$","test_preprocessor",{}]],"transformIgnorePatterns":["/node_modules/"],"waitForUnhandledRejections":false,"watchPathIgnorePatterns":[]},"configString":"{\\"automock\\":false,\\"cache\\":true,\\"cacheDirectory\\":\\"/cache/\\",\\"clearMocks\\":false,\\"collectCoverage\\":false,\\"collectCoverageFrom\\":[\\"src\\",\\"!public\\"],\\"coverageDirectory\\":\\"coverage\\",\\"coveragePathIgnorePatterns\\":[],\\"coverageProvider\\":\\"babel\\",\\"coverageReporters\\":[],\\"cwd\\":\\"/test_root_dir/\\",\\"detectLeaks\\":false,\\"detectOpenHandles\\":false,\\"errorOnDeprecated\\":false,\\"extensionsToTreatAsEsm\\":[],\\"fakeTimers\\":{\\"enableGlobally\\":false},\\"forceCoverageMatch\\":[],\\"globals\\":{},\\"haste\\":{},\\"id\\":\\"test\\",\\"injectGlobals\\":true,\\"moduleDirectories\\":[],\\"moduleFileExtensions\\":[\\"js\\"],\\"moduleNameMapper\\":[],\\"modulePathIgnorePatterns\\":[],\\"modulePaths\\":[],\\"openHandlesTimeout\\":1000,\\"prettierPath\\":\\"prettier\\",\\"reporters\\":[\\"default\\",\\"custom-reporter-1\\",[\\"custom-reporter-2\\",{\\"configValue\\":true}]],\\"resetMocks\\":false,\\"resetModules\\":false,\\"restoreMocks\\":false,\\"rootDir\\":\\"/\\",\\"roots\\":[],\\"runner\\":\\"jest-runner\\",\\"runnerOptions\\":{},\\"runtime\\":\\"/test_module_loader_path\\",\\"sandboxInjectedGlobals\\":[],\\"setupFiles\\":[],\\"setupFilesAfterEnv\\":[],\\"skipFilter\\":false,\\"skipNodeResolution\\":false,\\"slowTestThreshold\\":5,\\"snapshotFormat\\":{},\\"snapshotSerializers\\":[],\\"testEnvironment\\":\\"node\\",\\"testEnvironmentOptions\\":{},\\"testLocationInResults\\":false,\\"testMatch\\":[],\\"testPathIgnorePatterns\\":[],\\"testRegex\\":[\\"\\\\\\\\.test\\\\\\\\.js$\\"],\\"testRunner\\":\\"jest-circus/runner\\",\\"testTimeout\\":5000,\\"transform\\":[[\\"\\\\\\\\.js$\\",\\"test_preprocessor\\",{}]],\\"transformIgnorePatterns\\":[\\"/node_modules/\\"],\\"waitForUnhandledRejections\\":false,\\"watchPathIgnorePatterns\\":[]}","transformerConfig":{}}',
};"
`;
@@ -231,6 +232,7 @@ exports[`ScriptTransformer passes expected transform options to getCacheKey 1`]
"rootDir": "/",
"roots": Array [],
"runner": "jest-runner",
"runnerOptions": Object {},
"runtime": "/test_module_loader_path",
"sandboxInjectedGlobals": Array [],
"setupFiles": Array [],
@@ -267,7 +269,7 @@ exports[`ScriptTransformer passes expected transform options to getCacheKey 1`]
"waitForUnhandledRejections": false,
"watchPathIgnorePatterns": Array [],
},
"configString": "{"automock":false,"cache":true,"cacheDirectory":"/cache/","clearMocks":false,"collectCoverage":false,"collectCoverageFrom":["src","!public"],"coverageDirectory":"coverage","coveragePathIgnorePatterns":[],"coverageProvider":"babel","coverageReporters":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extensionsToTreatAsEsm":[],"fakeTimers":{"enableGlobally":false},"forceCoverageMatch":[],"globals":{},"haste":{},"id":"test","injectGlobals":true,"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"openHandlesTimeout":1000,"prettierPath":"prettier","reporters":["default","custom-reporter-1",["custom-reporter-2",{"configValue":true}]],"resetMocks":false,"resetModules":false,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","runtime":"/test_module_loader_path","sandboxInjectedGlobals":[],"setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"slowTestThreshold":5,"snapshotFormat":{},"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-circus/runner","testTimeout":5000,"transform":[["\\\\.js$","test_preprocessor",{"configKey":"configValue"}]],"transformIgnorePatterns":["/node_modules/"],"waitForUnhandledRejections":false,"watchPathIgnorePatterns":[]}",
"configString": "{"automock":false,"cache":true,"cacheDirectory":"/cache/","clearMocks":false,"collectCoverage":false,"collectCoverageFrom":["src","!public"],"coverageDirectory":"coverage","coveragePathIgnorePatterns":[],"coverageProvider":"babel","coverageReporters":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extensionsToTreatAsEsm":[],"fakeTimers":{"enableGlobally":false},"forceCoverageMatch":[],"globals":{},"haste":{},"id":"test","injectGlobals":true,"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"openHandlesTimeout":1000,"prettierPath":"prettier","reporters":["default","custom-reporter-1",["custom-reporter-2",{"configValue":true}]],"resetMocks":false,"resetModules":false,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","runnerOptions":{},"runtime":"/test_module_loader_path","sandboxInjectedGlobals":[],"setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"slowTestThreshold":5,"snapshotFormat":{},"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-circus/runner","testTimeout":5000,"transform":[["\\\\.js$","test_preprocessor",{"configKey":"configValue"}]],"transformIgnorePatterns":["/node_modules/"],"waitForUnhandledRejections":false,"watchPathIgnorePatterns":[]}",
"coverageProvider": "babel",
"instrument": true,
"supportsDynamicImport": false,
@@ -358,6 +360,7 @@ exports[`ScriptTransformer passes expected transform options to getCacheKeyAsync
"rootDir": "/",
"roots": Array [],
"runner": "jest-runner",
"runnerOptions": Object {},
"runtime": "/test_module_loader_path",
"sandboxInjectedGlobals": Array [],
"setupFiles": Array [],
@@ -394,7 +397,7 @@ exports[`ScriptTransformer passes expected transform options to getCacheKeyAsync
"waitForUnhandledRejections": false,
"watchPathIgnorePatterns": Array [],
},
"configString": "{"automock":false,"cache":true,"cacheDirectory":"/cache/","clearMocks":false,"collectCoverage":false,"collectCoverageFrom":["src","!public"],"coverageDirectory":"coverage","coveragePathIgnorePatterns":[],"coverageProvider":"babel","coverageReporters":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extensionsToTreatAsEsm":[],"fakeTimers":{"enableGlobally":false},"forceCoverageMatch":[],"globals":{},"haste":{},"id":"test","injectGlobals":true,"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"openHandlesTimeout":1000,"prettierPath":"prettier","reporters":["default","custom-reporter-1",["custom-reporter-2",{"configValue":true}]],"resetMocks":false,"resetModules":false,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","runtime":"/test_module_loader_path","sandboxInjectedGlobals":[],"setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"slowTestThreshold":5,"snapshotFormat":{},"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-circus/runner","testTimeout":5000,"transform":[["\\\\.js$","test_async_preprocessor",{"configKey":"configValue"}]],"transformIgnorePatterns":["/node_modules/"],"waitForUnhandledRejections":false,"watchPathIgnorePatterns":[]}",
"configString": "{"automock":false,"cache":true,"cacheDirectory":"/cache/","clearMocks":false,"collectCoverage":false,"collectCoverageFrom":["src","!public"],"coverageDirectory":"coverage","coveragePathIgnorePatterns":[],"coverageProvider":"babel","coverageReporters":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extensionsToTreatAsEsm":[],"fakeTimers":{"enableGlobally":false},"forceCoverageMatch":[],"globals":{},"haste":{},"id":"test","injectGlobals":true,"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"openHandlesTimeout":1000,"prettierPath":"prettier","reporters":["default","custom-reporter-1",["custom-reporter-2",{"configValue":true}]],"resetMocks":false,"resetModules":false,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","runnerOptions":{},"runtime":"/test_module_loader_path","sandboxInjectedGlobals":[],"setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"slowTestThreshold":5,"snapshotFormat":{},"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-circus/runner","testTimeout":5000,"transform":[["\\\\.js$","test_async_preprocessor",{"configKey":"configValue"}]],"transformIgnorePatterns":["/node_modules/"],"waitForUnhandledRejections":false,"watchPathIgnorePatterns":[]}",
"coverageProvider": "babel",
"instrument": true,
"supportsDynamicImport": false,
@@ -832,7 +835,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,"collectCoverage":false,"collectCoverageFrom":["src","!public"],"coverageDirectory":"coverage","coveragePathIgnorePatterns":[],"coverageProvider":"babel","coverageReporters":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extensionsToTreatAsEsm":[],"fakeTimers":{"enableGlobally":false},"forceCoverageMatch":[],"globals":{},"haste":{},"id":"test","injectGlobals":true,"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"openHandlesTimeout":1000,"prettierPath":"prettier","reporters":["default","custom-reporter-1",["custom-reporter-2",{"configValue":true}]],"resetMocks":false,"resetModules":false,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","runtime":"/test_module_loader_path","sandboxInjectedGlobals":[],"setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"slowTestThreshold":5,"snapshotFormat":{},"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-circus/runner","testTimeout":5000,"transform":[["\\\\.js$","test_async_preprocessor",{}],["\\\\.css$","css-preprocessor",{}]],"transformIgnorePatterns":["/node_modules/"],"waitForUnhandledRejections":false,"watchPathIgnorePatterns":[]},"configString":"{\\"automock\\":false,\\"cache\\":true,\\"cacheDirectory\\":\\"/cache/\\",\\"clearMocks\\":false,\\"collectCoverage\\":false,\\"collectCoverageFrom\\":[\\"src\\",\\"!public\\"],\\"coverageDirectory\\":\\"coverage\\",\\"coveragePathIgnorePatterns\\":[],\\"coverageProvider\\":\\"babel\\",\\"coverageReporters\\":[],\\"cwd\\":\\"/test_root_dir/\\",\\"detectLeaks\\":false,\\"detectOpenHandles\\":false,\\"errorOnDeprecated\\":false,\\"extensionsToTreatAsEsm\\":[],\\"fakeTimers\\":{\\"enableGlobally\\":false},\\"forceCoverageMatch\\":[],\\"globals\\":{},\\"haste\\":{},\\"id\\":\\"test\\",\\"injectGlobals\\":true,\\"moduleDirectories\\":[],\\"moduleFileExtensions\\":[\\"js\\"],\\"moduleNameMapper\\":[],\\"modulePathIgnorePatterns\\":[],\\"modulePaths\\":[],\\"openHandlesTimeout\\":1000,\\"prettierPath\\":\\"prettier\\",\\"reporters\\":[\\"default\\",\\"custom-reporter-1\\",[\\"custom-reporter-2\\",{\\"configValue\\":true}]],\\"resetMocks\\":false,\\"resetModules\\":false,\\"restoreMocks\\":false,\\"rootDir\\":\\"/\\",\\"roots\\":[],\\"runner\\":\\"jest-runner\\",\\"runtime\\":\\"/test_module_loader_path\\",\\"sandboxInjectedGlobals\\":[],\\"setupFiles\\":[],\\"setupFilesAfterEnv\\":[],\\"skipFilter\\":false,\\"skipNodeResolution\\":false,\\"slowTestThreshold\\":5,\\"snapshotFormat\\":{},\\"snapshotSerializers\\":[],\\"testEnvironment\\":\\"node\\",\\"testEnvironmentOptions\\":{},\\"testLocationInResults\\":false,\\"testMatch\\":[],\\"testPathIgnorePatterns\\":[],\\"testRegex\\":[\\"\\\\\\\\.test\\\\\\\\.js$\\"],\\"testRunner\\":\\"jest-circus/runner\\",\\"testTimeout\\":5000,\\"transform\\":[[\\"\\\\\\\\.js$\\",\\"test_async_preprocessor\\",{}],[\\"\\\\\\\\.css$\\",\\"css-preprocessor\\",{}]],\\"transformIgnorePatterns\\":[\\"/node_modules/\\"],\\"waitForUnhandledRejections\\":false,\\"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,"collectCoverage":false,"collectCoverageFrom":["src","!public"],"coverageDirectory":"coverage","coveragePathIgnorePatterns":[],"coverageProvider":"babel","coverageReporters":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extensionsToTreatAsEsm":[],"fakeTimers":{"enableGlobally":false},"forceCoverageMatch":[],"globals":{},"haste":{},"id":"test","injectGlobals":true,"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"openHandlesTimeout":1000,"prettierPath":"prettier","reporters":["default","custom-reporter-1",["custom-reporter-2",{"configValue":true}]],"resetMocks":false,"resetModules":false,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","runnerOptions":{},"runtime":"/test_module_loader_path","sandboxInjectedGlobals":[],"setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"slowTestThreshold":5,"snapshotFormat":{},"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-circus/runner","testTimeout":5000,"transform":[["\\\\.js$","test_async_preprocessor",{}],["\\\\.css$","css-preprocessor",{}]],"transformIgnorePatterns":["/node_modules/"],"waitForUnhandledRejections":false,"watchPathIgnorePatterns":[]},"configString":"{\\"automock\\":false,\\"cache\\":true,\\"cacheDirectory\\":\\"/cache/\\",\\"clearMocks\\":false,\\"collectCoverage\\":false,\\"collectCoverageFrom\\":[\\"src\\",\\"!public\\"],\\"coverageDirectory\\":\\"coverage\\",\\"coveragePathIgnorePatterns\\":[],\\"coverageProvider\\":\\"babel\\",\\"coverageReporters\\":[],\\"cwd\\":\\"/test_root_dir/\\",\\"detectLeaks\\":false,\\"detectOpenHandles\\":false,\\"errorOnDeprecated\\":false,\\"extensionsToTreatAsEsm\\":[],\\"fakeTimers\\":{\\"enableGlobally\\":false},\\"forceCoverageMatch\\":[],\\"globals\\":{},\\"haste\\":{},\\"id\\":\\"test\\",\\"injectGlobals\\":true,\\"moduleDirectories\\":[],\\"moduleFileExtensions\\":[\\"js\\"],\\"moduleNameMapper\\":[],\\"modulePathIgnorePatterns\\":[],\\"modulePaths\\":[],\\"openHandlesTimeout\\":1000,\\"prettierPath\\":\\"prettier\\",\\"reporters\\":[\\"default\\",\\"custom-reporter-1\\",[\\"custom-reporter-2\\",{\\"configValue\\":true}]],\\"resetMocks\\":false,\\"resetModules\\":false,\\"restoreMocks\\":false,\\"rootDir\\":\\"/\\",\\"roots\\":[],\\"runner\\":\\"jest-runner\\",\\"runnerOptions\\":{},\\"runtime\\":\\"/test_module_loader_path\\",\\"sandboxInjectedGlobals\\":[],\\"setupFiles\\":[],\\"setupFilesAfterEnv\\":[],\\"skipFilter\\":false,\\"skipNodeResolution\\":false,\\"slowTestThreshold\\":5,\\"snapshotFormat\\":{},\\"snapshotSerializers\\":[],\\"testEnvironment\\":\\"node\\",\\"testEnvironmentOptions\\":{},\\"testLocationInResults\\":false,\\"testMatch\\":[],\\"testPathIgnorePatterns\\":[],\\"testRegex\\":[\\"\\\\\\\\.test\\\\\\\\.js$\\"],\\"testRunner\\":\\"jest-circus/runner\\",\\"testTimeout\\":5000,\\"transform\\":[[\\"\\\\\\\\.js$\\",\\"test_async_preprocessor\\",{}],[\\"\\\\\\\\.css$\\",\\"css-preprocessor\\",{}]],\\"transformIgnorePatterns\\":[\\"/node_modules/\\"],\\"waitForUnhandledRejections\\":false,\\"watchPathIgnorePatterns\\":[]}","transformerConfig":{}}',
};"
`;
@@ -849,7 +852,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,"collectCoverage":false,"collectCoverageFrom":["src","!public"],"coverageDirectory":"coverage","coveragePathIgnorePatterns":[],"coverageProvider":"babel","coverageReporters":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extensionsToTreatAsEsm":[],"fakeTimers":{"enableGlobally":false},"forceCoverageMatch":[],"globals":{},"haste":{},"id":"test","injectGlobals":true,"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"openHandlesTimeout":1000,"prettierPath":"prettier","reporters":["default","custom-reporter-1",["custom-reporter-2",{"configValue":true}]],"resetMocks":false,"resetModules":false,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","runtime":"/test_module_loader_path","sandboxInjectedGlobals":[],"setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"slowTestThreshold":5,"snapshotFormat":{},"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-circus/runner","testTimeout":5000,"transform":[["\\\\.js$","test_preprocessor",{}],["\\\\.css$","css-preprocessor",{}]],"transformIgnorePatterns":["/node_modules/"],"waitForUnhandledRejections":false,"watchPathIgnorePatterns":[]},"configString":"{\\"automock\\":false,\\"cache\\":true,\\"cacheDirectory\\":\\"/cache/\\",\\"clearMocks\\":false,\\"collectCoverage\\":false,\\"collectCoverageFrom\\":[\\"src\\",\\"!public\\"],\\"coverageDirectory\\":\\"coverage\\",\\"coveragePathIgnorePatterns\\":[],\\"coverageProvider\\":\\"babel\\",\\"coverageReporters\\":[],\\"cwd\\":\\"/test_root_dir/\\",\\"detectLeaks\\":false,\\"detectOpenHandles\\":false,\\"errorOnDeprecated\\":false,\\"extensionsToTreatAsEsm\\":[],\\"fakeTimers\\":{\\"enableGlobally\\":false},\\"forceCoverageMatch\\":[],\\"globals\\":{},\\"haste\\":{},\\"id\\":\\"test\\",\\"injectGlobals\\":true,\\"moduleDirectories\\":[],\\"moduleFileExtensions\\":[\\"js\\"],\\"moduleNameMapper\\":[],\\"modulePathIgnorePatterns\\":[],\\"modulePaths\\":[],\\"openHandlesTimeout\\":1000,\\"prettierPath\\":\\"prettier\\",\\"reporters\\":[\\"default\\",\\"custom-reporter-1\\",[\\"custom-reporter-2\\",{\\"configValue\\":true}]],\\"resetMocks\\":false,\\"resetModules\\":false,\\"restoreMocks\\":false,\\"rootDir\\":\\"/\\",\\"roots\\":[],\\"runner\\":\\"jest-runner\\",\\"runtime\\":\\"/test_module_loader_path\\",\\"sandboxInjectedGlobals\\":[],\\"setupFiles\\":[],\\"setupFilesAfterEnv\\":[],\\"skipFilter\\":false,\\"skipNodeResolution\\":false,\\"slowTestThreshold\\":5,\\"snapshotFormat\\":{},\\"snapshotSerializers\\":[],\\"testEnvironment\\":\\"node\\",\\"testEnvironmentOptions\\":{},\\"testLocationInResults\\":false,\\"testMatch\\":[],\\"testPathIgnorePatterns\\":[],\\"testRegex\\":[\\"\\\\\\\\.test\\\\\\\\.js$\\"],\\"testRunner\\":\\"jest-circus/runner\\",\\"testTimeout\\":5000,\\"transform\\":[[\\"\\\\\\\\.js$\\",\\"test_preprocessor\\",{}],[\\"\\\\\\\\.css$\\",\\"css-preprocessor\\",{}]],\\"transformIgnorePatterns\\":[\\"/node_modules/\\"],\\"waitForUnhandledRejections\\":false,\\"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,"collectCoverage":false,"collectCoverageFrom":["src","!public"],"coverageDirectory":"coverage","coveragePathIgnorePatterns":[],"coverageProvider":"babel","coverageReporters":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extensionsToTreatAsEsm":[],"fakeTimers":{"enableGlobally":false},"forceCoverageMatch":[],"globals":{},"haste":{},"id":"test","injectGlobals":true,"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"openHandlesTimeout":1000,"prettierPath":"prettier","reporters":["default","custom-reporter-1",["custom-reporter-2",{"configValue":true}]],"resetMocks":false,"resetModules":false,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","runnerOptions":{},"runtime":"/test_module_loader_path","sandboxInjectedGlobals":[],"setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"slowTestThreshold":5,"snapshotFormat":{},"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-circus/runner","testTimeout":5000,"transform":[["\\\\.js$","test_preprocessor",{}],["\\\\.css$","css-preprocessor",{}]],"transformIgnorePatterns":["/node_modules/"],"waitForUnhandledRejections":false,"watchPathIgnorePatterns":[]},"configString":"{\\"automock\\":false,\\"cache\\":true,\\"cacheDirectory\\":\\"/cache/\\",\\"clearMocks\\":false,\\"collectCoverage\\":false,\\"collectCoverageFrom\\":[\\"src\\",\\"!public\\"],\\"coverageDirectory\\":\\"coverage\\",\\"coveragePathIgnorePatterns\\":[],\\"coverageProvider\\":\\"babel\\",\\"coverageReporters\\":[],\\"cwd\\":\\"/test_root_dir/\\",\\"detectLeaks\\":false,\\"detectOpenHandles\\":false,\\"errorOnDeprecated\\":false,\\"extensionsToTreatAsEsm\\":[],\\"fakeTimers\\":{\\"enableGlobally\\":false},\\"forceCoverageMatch\\":[],\\"globals\\":{},\\"haste\\":{},\\"id\\":\\"test\\",\\"injectGlobals\\":true,\\"moduleDirectories\\":[],\\"moduleFileExtensions\\":[\\"js\\"],\\"moduleNameMapper\\":[],\\"modulePathIgnorePatterns\\":[],\\"modulePaths\\":[],\\"openHandlesTimeout\\":1000,\\"prettierPath\\":\\"prettier\\",\\"reporters\\":[\\"default\\",\\"custom-reporter-1\\",[\\"custom-reporter-2\\",{\\"configValue\\":true}]],\\"resetMocks\\":false,\\"resetModules\\":false,\\"restoreMocks\\":false,\\"rootDir\\":\\"/\\",\\"roots\\":[],\\"runner\\":\\"jest-runner\\",\\"runnerOptions\\":{},\\"runtime\\":\\"/test_module_loader_path\\",\\"sandboxInjectedGlobals\\":[],\\"setupFiles\\":[],\\"setupFilesAfterEnv\\":[],\\"skipFilter\\":false,\\"skipNodeResolution\\":false,\\"slowTestThreshold\\":5,\\"snapshotFormat\\":{},\\"snapshotSerializers\\":[],\\"testEnvironment\\":\\"node\\",\\"testEnvironmentOptions\\":{},\\"testLocationInResults\\":false,\\"testMatch\\":[],\\"testPathIgnorePatterns\\":[],\\"testRegex\\":[\\"\\\\\\\\.test\\\\\\\\.js$\\"],\\"testRunner\\":\\"jest-circus/runner\\",\\"testTimeout\\":5000,\\"transform\\":[[\\"\\\\\\\\.js$\\",\\"test_preprocessor\\",{}],[\\"\\\\\\\\.css$\\",\\"css-preprocessor\\",{}]],\\"transformIgnorePatterns\\":[\\"/node_modules/\\"],\\"waitForUnhandledRejections\\":false,\\"watchPathIgnorePatterns\\":[]}","transformerConfig":{}}',
};"
`;
@@ -866,7 +869,7 @@ 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,"collectCoverage":false,"collectCoverageFrom":["src","!public"],"coverageDirectory":"coverage","coveragePathIgnorePatterns":[],"coverageProvider":"babel","coverageReporters":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extensionsToTreatAsEsm":[],"fakeTimers":{"enableGlobally":false},"forceCoverageMatch":[],"globals":{},"haste":{},"id":"test","injectGlobals":true,"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"openHandlesTimeout":1000,"prettierPath":"prettier","reporters":["default","custom-reporter-1",["custom-reporter-2",{"configValue":true}]],"resetMocks":false,"resetModules":false,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","runtime":"/test_module_loader_path","sandboxInjectedGlobals":[],"setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"slowTestThreshold":5,"snapshotFormat":{},"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-circus/runner","testTimeout":5000,"transform":[["\\\\.js$","test_preprocessor",{}]],"transformIgnorePatterns":["/node_modules/"],"waitForUnhandledRejections":false,"watchPathIgnorePatterns":[]},"configString":"{\\"automock\\":false,\\"cache\\":true,\\"cacheDirectory\\":\\"/cache/\\",\\"clearMocks\\":false,\\"collectCoverage\\":false,\\"collectCoverageFrom\\":[\\"src\\",\\"!public\\"],\\"coverageDirectory\\":\\"coverage\\",\\"coveragePathIgnorePatterns\\":[],\\"coverageProvider\\":\\"babel\\",\\"coverageReporters\\":[],\\"cwd\\":\\"/test_root_dir/\\",\\"detectLeaks\\":false,\\"detectOpenHandles\\":false,\\"errorOnDeprecated\\":false,\\"extensionsToTreatAsEsm\\":[],\\"fakeTimers\\":{\\"enableGlobally\\":false},\\"forceCoverageMatch\\":[],\\"globals\\":{},\\"haste\\":{},\\"id\\":\\"test\\",\\"injectGlobals\\":true,\\"moduleDirectories\\":[],\\"moduleFileExtensions\\":[\\"js\\"],\\"moduleNameMapper\\":[],\\"modulePathIgnorePatterns\\":[],\\"modulePaths\\":[],\\"openHandlesTimeout\\":1000,\\"prettierPath\\":\\"prettier\\",\\"reporters\\":[\\"default\\",\\"custom-reporter-1\\",[\\"custom-reporter-2\\",{\\"configValue\\":true}]],\\"resetMocks\\":false,\\"resetModules\\":false,\\"restoreMocks\\":false,\\"rootDir\\":\\"/\\",\\"roots\\":[],\\"runner\\":\\"jest-runner\\",\\"runtime\\":\\"/test_module_loader_path\\",\\"sandboxInjectedGlobals\\":[],\\"setupFiles\\":[],\\"setupFilesAfterEnv\\":[],\\"skipFilter\\":false,\\"skipNodeResolution\\":false,\\"slowTestThreshold\\":5,\\"snapshotFormat\\":{},\\"snapshotSerializers\\":[],\\"testEnvironment\\":\\"node\\",\\"testEnvironmentOptions\\":{},\\"testLocationInResults\\":false,\\"testMatch\\":[],\\"testPathIgnorePatterns\\":[],\\"testRegex\\":[\\"\\\\\\\\.test\\\\\\\\.js$\\"],\\"testRunner\\":\\"jest-circus/runner\\",\\"testTimeout\\":5000,\\"transform\\":[[\\"\\\\\\\\.js$\\",\\"test_preprocessor\\",{}]],\\"transformIgnorePatterns\\":[\\"/node_modules/\\"],\\"waitForUnhandledRejections\\":false,\\"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,"collectCoverage":false,"collectCoverageFrom":["src","!public"],"coverageDirectory":"coverage","coveragePathIgnorePatterns":[],"coverageProvider":"babel","coverageReporters":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extensionsToTreatAsEsm":[],"fakeTimers":{"enableGlobally":false},"forceCoverageMatch":[],"globals":{},"haste":{},"id":"test","injectGlobals":true,"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"openHandlesTimeout":1000,"prettierPath":"prettier","reporters":["default","custom-reporter-1",["custom-reporter-2",{"configValue":true}]],"resetMocks":false,"resetModules":false,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","runnerOptions":{},"runtime":"/test_module_loader_path","sandboxInjectedGlobals":[],"setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"slowTestThreshold":5,"snapshotFormat":{},"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-circus/runner","testTimeout":5000,"transform":[["\\\\.js$","test_preprocessor",{}]],"transformIgnorePatterns":["/node_modules/"],"waitForUnhandledRejections":false,"watchPathIgnorePatterns":[]},"configString":"{\\"automock\\":false,\\"cache\\":true,\\"cacheDirectory\\":\\"/cache/\\",\\"clearMocks\\":false,\\"collectCoverage\\":false,\\"collectCoverageFrom\\":[\\"src\\",\\"!public\\"],\\"coverageDirectory\\":\\"coverage\\",\\"coveragePathIgnorePatterns\\":[],\\"coverageProvider\\":\\"babel\\",\\"coverageReporters\\":[],\\"cwd\\":\\"/test_root_dir/\\",\\"detectLeaks\\":false,\\"detectOpenHandles\\":false,\\"errorOnDeprecated\\":false,\\"extensionsToTreatAsEsm\\":[],\\"fakeTimers\\":{\\"enableGlobally\\":false},\\"forceCoverageMatch\\":[],\\"globals\\":{},\\"haste\\":{},\\"id\\":\\"test\\",\\"injectGlobals\\":true,\\"moduleDirectories\\":[],\\"moduleFileExtensions\\":[\\"js\\"],\\"moduleNameMapper\\":[],\\"modulePathIgnorePatterns\\":[],\\"modulePaths\\":[],\\"openHandlesTimeout\\":1000,\\"prettierPath\\":\\"prettier\\",\\"reporters\\":[\\"default\\",\\"custom-reporter-1\\",[\\"custom-reporter-2\\",{\\"configValue\\":true}]],\\"resetMocks\\":false,\\"resetModules\\":false,\\"restoreMocks\\":false,\\"rootDir\\":\\"/\\",\\"roots\\":[],\\"runner\\":\\"jest-runner\\",\\"runnerOptions\\":{},\\"runtime\\":\\"/test_module_loader_path\\",\\"sandboxInjectedGlobals\\":[],\\"setupFiles\\":[],\\"setupFilesAfterEnv\\":[],\\"skipFilter\\":false,\\"skipNodeResolution\\":false,\\"slowTestThreshold\\":5,\\"snapshotFormat\\":{},\\"snapshotSerializers\\":[],\\"testEnvironment\\":\\"node\\",\\"testEnvironmentOptions\\":{},\\"testLocationInResults\\":false,\\"testMatch\\":[],\\"testPathIgnorePatterns\\":[],\\"testRegex\\":[\\"\\\\\\\\.test\\\\\\\\.js$\\"],\\"testRunner\\":\\"jest-circus/runner\\",\\"testTimeout\\":5000,\\"transform\\":[[\\"\\\\\\\\.js$\\",\\"test_preprocessor\\",{}]],\\"transformIgnorePatterns\\":[\\"/node_modules/\\"],\\"waitForUnhandledRejections\\":false,\\"watchPathIgnorePatterns\\":[]}","transformerConfig":{}}',
};"
`;
@@ -127,4 +127,25 @@ describe('Config', () => {
],
});
});
test('runner accepts string', () => {
expect(config).type.toBeAssignableFrom({
runner: 'jest-runner',
});
});
test('runner accepts tuple [string, object]', () => {
expect(config).type.toBeAssignableFrom({
runner: ['jest-runner', {numWorkers: 4}] as [
string,
Record<string, unknown>,
],
});
});
test('runner rejects invalid tuple', () => {
expect(config).type.not.toBeAssignableFrom({
runner: [123, {}],
});
});
});
+2 -1
View File
@@ -229,7 +229,7 @@ export type InitialOptionsWithRootDir = InitialOptions &
Required<Pick<InitialOptions, 'rootDir'>>;
export type InitialProjectOptions = Pick<
InitialOptions & {cwd?: string},
InitialOptions & {cwd?: string; runnerOptions?: Record<string, unknown>},
keyof ProjectConfig
>;
@@ -377,6 +377,7 @@ export type ProjectConfig = {
rootDir: string;
roots: Array<string>;
runner: string;
runnerOptions: Record<string, unknown>;
runtime?: string;
sandboxInjectedGlobals: Array<keyof typeof globalThis>;
setupFiles: Array<string>;
+1
View File
@@ -116,6 +116,7 @@ const DEFAULT_PROJECT_CONFIG: Config.ProjectConfig = {
rootDir: '/test_root_dir/',
roots: [],
runner: 'jest-runner',
runnerOptions: {},
runtime: '/test_module_loader_path',
sandboxInjectedGlobals: [],
setupFiles: [],
+1
View File
@@ -4265,6 +4265,7 @@ __metadata:
chalk: "npm:^4.1.2"
ci-info: "npm:^4.2.0"
exit-x: "npm:^0.2.2"
fast-json-stable-stringify: "npm:^2.1.0"
graceful-fs: "npm:^4.2.11"
jest-changed-files: "workspace:*"
jest-config: "workspace:*"