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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix jest crash on node #3206

Merged
merged 1 commit into from
May 18, 2023
Merged

chore: fix jest crash on node #3206

merged 1 commit into from
May 18, 2023

Conversation

hardfist
Copy link
Contributor

@hardfist hardfist commented May 18, 2023

Related issue (if exists)

Summary

it's a dirty hack for nodejs/node#35889

馃 Generated by Copilot at 7899b34

Renamed test config file to use CJS extension and removed unnecessary flag from test script. Added a workaround to load CJS config files with require() in loadConfig.ts to avoid jest bug with dynamic imports. Updated tsconfig.json to include the new file name.

Walkthrough

馃 Generated by Copilot at 7899b34

  • Removed NODE_OPTIONS=--experimental-vm-modules flag from test script to fix errors with jest and dynamic imports (link)
  • Added workaround to load CJS config files with require() instead of import() in requireWithAdditionalExtension function in loadConfig.ts (link)
  • Renamed test config file from test.rspack.config.js to test.rspack.config.cjs and updated test case in loadConfig.test.ts to match CJS extension (link, link)
  • Included new CJS test config file name in tsconfig.json file to enable TypeScript transpilation (link)

@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label May 18, 2023
Copy link
Contributor

@Boshen Boshen left a comment

Choose a reason for hiding this comment

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

Let's rerun the tests a few times before merging.

@hardfist
Copy link
Contributor Author

Let's rerun the tests a few times before merging.

run multi times it should pass

@hardfist hardfist added this pull request to the merge queue May 18, 2023
Merged via the queue into main with commit 72ba455 May 18, 2023
18 checks passed
@hardfist hardfist deleted the fix-jest-crash branch May 18, 2023 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team The issue/pr is created by the member of Rspack.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants