Skip to content

Commit 0efb1d7

Browse files
arcanisscotthovestadt
authored andcommitted
Resolves the test sequencer even when not explicitly set (#8267)
* Fixes the test-sequencer resolution w/ pnp * Update CHANGELOG.md * Update normalize.ts * Update normalize.ts * Fixes snapshot * Fix testSequencer value being overwritten by 'old style' of options.
1 parent 3e92cb1 commit 0efb1d7

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Fixes
66

7+
- `[@jest/config]` Normalize `testSequencer` to its absolute path ([#8267](https://github.com/facebook/jest/pull/8267))
78
- `[@jest/console]` Print to stderr when calling `console.error`, `console.warn` or `console.assert` using the `jest-runtime` CLI ([#8261](https://github.com/facebook/jest/pull/8261))
89

910
### Chore & Maintenance

e2e/__tests__/__snapshots__/showConfig.test.ts.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ exports[`--showConfig outputs config info and exits 1`] = `
117117
"testFailureExitCode": 1,
118118
"testPathPattern": "",
119119
"testResultsProcessor": null,
120-
"testSequencer": "@jest/test-sequencer",
120+
"testSequencer": "<<REPLACED_JEST_PACKAGES_DIR>>/jest-test-sequencer/build/index.js",
121121
"updateSnapshot": "all",
122122
"useStderr": false,
123123
"verbose": null,

packages/jest-config/src/normalize.ts

+5-11
Original file line numberDiff line numberDiff line change
@@ -589,17 +589,6 @@ export default function normalize(
589589
});
590590
}
591591
break;
592-
case 'testSequencer':
593-
{
594-
const option = oldOptions[key];
595-
value =
596-
option &&
597-
getSequencer(newOptions.resolver, {
598-
filePath: option,
599-
rootDir: options.rootDir,
600-
});
601-
}
602-
break;
603592
case 'prettierPath':
604593
{
605594
// We only want this to throw if "prettierPath" is explicitly passed
@@ -883,6 +872,11 @@ export default function normalize(
883872
// ignored
884873
}
885874

875+
newOptions.testSequencer = getSequencer(newOptions.resolver, {
876+
filePath: options.testSequencer || DEFAULT_CONFIG.testSequencer,
877+
rootDir: options.rootDir,
878+
});
879+
886880
newOptions.nonFlagArgs = argv._;
887881
newOptions.testPathPattern = buildTestPathPattern(argv);
888882
newOptions.json = !!argv.json;

0 commit comments

Comments
 (0)