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

Conversation

arcanis
Copy link
Contributor

@arcanis arcanis commented Apr 3, 2019

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

SimenB commented Apr 3, 2019

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

Yeah...

@@ -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)

Copy link
Member

@SimenB SimenB left a comment

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 😀

Copy link
Contributor

@scotthovestadt scotthovestadt left a comment

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
Contributor

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

@github-actions
Copy link

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