From 0efb1d7809cb96ae87a7601e7802f1dab3774280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Nison?= Date: Wed, 3 Apr 2019 23:54:13 +0100 Subject: [PATCH] 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. --- CHANGELOG.md | 1 + .../__snapshots__/showConfig.test.ts.snap | 2 +- packages/jest-config/src/normalize.ts | 16 +++++----------- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4a1e92d436a..c298f3b321ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/e2e/__tests__/__snapshots__/showConfig.test.ts.snap b/e2e/__tests__/__snapshots__/showConfig.test.ts.snap index 44f0f007f29a..dbafaaad3ca1 100644 --- a/e2e/__tests__/__snapshots__/showConfig.test.ts.snap +++ b/e2e/__tests__/__snapshots__/showConfig.test.ts.snap @@ -117,7 +117,7 @@ exports[`--showConfig outputs config info and exits 1`] = ` "testFailureExitCode": 1, "testPathPattern": "", "testResultsProcessor": null, - "testSequencer": "@jest/test-sequencer", + "testSequencer": "<>/jest-test-sequencer/build/index.js", "updateSnapshot": "all", "useStderr": false, "verbose": null, diff --git a/packages/jest-config/src/normalize.ts b/packages/jest-config/src/normalize.ts index 335b8c1e2293..fa9c5fad1adf 100644 --- a/packages/jest-config/src/normalize.ts +++ b/packages/jest-config/src/normalize.ts @@ -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 @@ -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;