Skip to content

Resolves the test sequencer even when not explicitly set - #8267

Merged
scotthovestadt merged 7 commits into
masterfrom
resolve-test-sequencer
Apr 3, 2019
Merged

Resolves the test sequencer even when not explicitly set#8267
scotthovestadt merged 7 commits into
masterfrom
resolve-test-sequencer

Conversation

@arcanis

@arcanis arcanis commented Apr 3, 2019

Copy link
Copy Markdown
Contributor

Summary

The default value of the test sequencer isn't resolved unless explicitly set (we only iterate on options, which contains the user-defined options but not the default ones). This diff ensures that we call require.resolve to obtain the real default path of the sequencer (since @jest/core is making the require call, it would fail otherwise under PnP).

Test plan

I modified the code in my cache and checked that my tests were running. We probably should try to add an integration test for PnP at some point.

@SimenB

SimenB commented Apr 3, 2019

Copy link
Copy Markdown
Member

We probably should try to add an integration test for PnP at some point.

Yeah...

Comment thread packages/jest-config/src/normalize.ts Outdated
options.testRunner = require.resolve('jest-jasmine2');
}

if (!options.testSequencer) {

@SimenB SimenB Apr 3, 2019

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
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)

@SimenB SimenB left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If my comment doesn't make sense, feel free to ignore it 😀

@scotthovestadt scotthovestadt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you! Just a lint error to resolve and then will release it.

@scotthovestadt

Copy link
Copy Markdown
Contributor

e2e test customTestSequencers.test.ts is failing, looking into it

@github-actions

Copy link
Copy Markdown

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants