Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolves the test sequencer even when not explicitly set #8267

Merged
merged 7 commits into from Apr 3, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,8 @@

### Fixes

- `[@jest/config]` Normalize `testSequencer` to its absolute path ([#8267](https://github.com/facebook/jest/pull/8267))

### Chore & Maintenance

### Performance
Expand Down
4 changes: 4 additions & 0 deletions packages/jest-config/src/normalize.ts
Expand Up @@ -478,6 +478,10 @@ export default function normalize(
options.testRunner = require.resolve('jest-jasmine2');
}

if (!options.testSequencer) {
Copy link
Member

@SimenB SimenB Apr 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch. Do we need the if at all? Or can we do what we do on line 463?

  options.testEnvironment = getTestEnvironment({
    rootDir: options.rootDir,
    testEnvironment: options.testEnvironment || DEFAULT_CONFIG.testEnvironment,
  });

So (ish)

  options.testSequencer = getTestSequencer({
    rootDir: options.rootDir,
    testSequencer: options.testSequencer || DEFAULT_CONFIG.testSequencer,
  });

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(might be a slippery slope, and should rather be part of a larger refactor of normalize)

options.testSequencer = require.resolve('@jest/test-sequencer');
}

if (!options.coverageDirectory) {
options.coverageDirectory = path.resolve(options.rootDir, 'coverage');
}
Expand Down