Skip to content

Commit

Permalink
Resolves the test sequencer even when not explicitly set (#8267)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
arcanis authored and scotthovestadt committed Apr 3, 2019
1 parent 3e92cb1 commit 0efb1d7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,7 @@

### Fixes

- `[@jest/config]` Normalize `testSequencer` to its absolute path ([#8267](https://github.com/facebook/jest/pull/8267))
- `[@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))

### Chore & Maintenance
Expand Down
2 changes: 1 addition & 1 deletion e2e/__tests__/__snapshots__/showConfig.test.ts.snap
Expand Up @@ -117,7 +117,7 @@ exports[`--showConfig outputs config info and exits 1`] = `
"testFailureExitCode": 1,
"testPathPattern": "",
"testResultsProcessor": null,
"testSequencer": "@jest/test-sequencer",
"testSequencer": "<<REPLACED_JEST_PACKAGES_DIR>>/jest-test-sequencer/build/index.js",
"updateSnapshot": "all",
"useStderr": false,
"verbose": null,
Expand Down
16 changes: 5 additions & 11 deletions packages/jest-config/src/normalize.ts
Expand Up @@ -589,17 +589,6 @@ export default function normalize(
});
}
break;
case 'testSequencer':
{
const option = oldOptions[key];
value =
option &&
getSequencer(newOptions.resolver, {
filePath: option,
rootDir: options.rootDir,
});
}
break;
case 'prettierPath':
{
// We only want this to throw if "prettierPath" is explicitly passed
Expand Down Expand Up @@ -883,6 +872,11 @@ export default function normalize(
// ignored
}

newOptions.testSequencer = getSequencer(newOptions.resolver, {
filePath: options.testSequencer || DEFAULT_CONFIG.testSequencer,
rootDir: options.rootDir,
});

newOptions.nonFlagArgs = argv._;
newOptions.testPathPattern = buildTestPathPattern(argv);
newOptions.json = !!argv.json;
Expand Down

0 comments on commit 0efb1d7

Please sign in to comment.