Skip to content

Commit ea685a5

Browse files
authored
chore: make TestSequencer constructor argument mandatory (#14543)
1 parent 3374790 commit ea685a5

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
### Features
44

5-
- `[jest-test-sequencer, jest-core]` Exposes globalConfig & contexts to TestSequencer ([#14535](https://github.com/jestjs/jest/pull/14535))
5+
- `[@jest/test-sequencer, jest-core]` [**BREAKING**] Exposes `globalConfig` & `contexts` to `TestSequencer` ([#14535](https://github.com/jestjs/jest/pull/14535), & [#14543](https://github.com/jestjs/jest/pull/14543))
66

77
### Fixes
88

packages/jest-test-sequencer/src/__tests__/test_sequencer.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import * as path from 'path';
99
import * as mockedFs from 'graceful-fs';
1010
import type {AggregatedResult, Test, TestContext} from '@jest/test-result';
11-
import {makeProjectConfig} from '@jest/test-utils';
11+
import {makeGlobalConfig, makeProjectConfig} from '@jest/test-utils';
1212
import TestSequencer from '../index';
1313

1414
jest.mock('graceful-fs', () => ({
@@ -56,7 +56,10 @@ const toTests = (paths: Array<string>) =>
5656

5757
beforeEach(() => {
5858
jest.clearAllMocks();
59-
sequencer = new TestSequencer();
59+
sequencer = new TestSequencer({
60+
contexts: [],
61+
globalConfig: makeGlobalConfig(),
62+
});
6063
});
6164

6265
test('sorts by file size if there is no timing information', () => {

packages/jest-test-sequencer/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default class TestSequencer {
5353
private readonly _cache = new Map<TestContext, Cache>();
5454

5555
// eslint-disable-next-line @typescript-eslint/no-empty-function
56-
constructor(_options?: TestSequencerOptions) {}
56+
constructor(_options: TestSequencerOptions) {}
5757

5858
_getCachePath(testContext: TestContext): string {
5959
const {config} = testContext;

0 commit comments

Comments
 (0)