Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- `[babel-plugin-jest-hoist]` Use `denylist` instead of the deprecated `blacklist` for Babel 8 support ([#14109](https://github.com/jestjs/jest/pull/14109))
- `[expect]` Check error instance type for `toThrow/toThrowError` ([#14576](https://github.com/jestjs/jest/pull/14576))
- `[jest-circus]` [**BREAKING**] Prevent false test failures caused by promise rejections handled asynchronously ([#14315](https://github.com/jestjs/jest/pull/14315))
- `[jest-config]` Make sure to respect `runInBand` option ([#14578](https://github.com/facebook/jest/pull/14578))
- `[@jest/expect-utils]` Fix comparison of `DataView` ([#14408](https://github.com/jestjs/jest/pull/14408))
- `[jest-leak-detector]` Make leak-detector more aggressive when running GC ([#14526](https://github.com/jestjs/jest/pull/14526))
- `[jest-util]` Make sure `isInteractive` works in a browser ([#14552](https://github.com/jestjs/jest/pull/14552))
Expand Down
1 change: 1 addition & 0 deletions e2e/__tests__/__snapshots__/showConfig.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ exports[`--showConfig outputs config info and exits 1`] = `
"passWithNoTests": false,
"projects": [],
"rootDir": "<<REPLACED_ROOT_DIR>>",
"runInBand": false,
"runTestsByPath": false,
"seed": <<RANDOM_SEED>>,
"skipFilter": false,
Expand Down
14 changes: 14 additions & 0 deletions packages/jest-config/src/__tests__/normalize.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2215,3 +2215,17 @@ describe('randomize', () => {
expect(options.randomize).toBeFalsy();
});
});

describe('runInBand', () => {
test('always set it', async () => {
const {options} = await normalize({rootDir: '/root/'}, {} as Config.Argv);
expect(options.runInBand).toBe(false);
});

test('respect argv', async () => {
const {options} = await normalize({rootDir: '/root/'}, {
runInBand: true,
} as Config.Argv);
expect(options.runInBand).toBe(true);
});
});
1 change: 1 addition & 0 deletions packages/jest-config/src/normalize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,7 @@ export default async function normalize(
10,
);
newOptions.maxWorkers = getMaxWorkers(argv, options);
newOptions.runInBand = argv.runInBand || false;

if (newOptions.testRegex.length > 0 && options.testMatch) {
throw createConfigError(
Expand Down