Skip to content

Commit

Permalink
chore: make TestSequencer constructor argument mandatory (#14543)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Sep 19, 2023
1 parent 3374790 commit ea685a5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

### Features

- `[jest-test-sequencer, jest-core]` Exposes globalConfig & contexts to TestSequencer ([#14535](https://github.com/jestjs/jest/pull/14535))
- `[@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))

### Fixes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import * as path from 'path';
import * as mockedFs from 'graceful-fs';
import type {AggregatedResult, Test, TestContext} from '@jest/test-result';
import {makeProjectConfig} from '@jest/test-utils';
import {makeGlobalConfig, makeProjectConfig} from '@jest/test-utils';
import TestSequencer from '../index';

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

beforeEach(() => {
jest.clearAllMocks();
sequencer = new TestSequencer();
sequencer = new TestSequencer({
contexts: [],
globalConfig: makeGlobalConfig(),
});
});

test('sorts by file size if there is no timing information', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-test-sequencer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default class TestSequencer {
private readonly _cache = new Map<TestContext, Cache>();

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

_getCachePath(testContext: TestContext): string {
const {config} = testContext;
Expand Down

0 comments on commit ea685a5

Please sign in to comment.