-
-
Notifications
You must be signed in to change notification settings - Fork 16
feat: output ES module format by default #763
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
Conversation
✅ Deploy Preview for rstest-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR changes the default output format from CommonJS to ES module format for Rstest. This is a breaking change that makes ES modules the default module system, aligning with modern JavaScript standards. Users can still opt-in to CommonJS format by explicitly setting output.module to false.
Key Changes:
- Changed default value of
output.modulefromfalsetotrue(ES module format is now the default) - Updated environment variable logic from
RSTEST_OUTPUT_MODULE === 'true'toRSTEST_OUTPUT_MODULE !== 'false'to enable by default - Updated all documentation and test files to reflect the new default behavior
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| website/docs/en/config/build/output.mdx | Updated English documentation to reflect new default value of true and inverted example code |
| website/docs/zh/config/build/output.mdx | Updated Chinese documentation to reflect new default value of true and inverted example code |
| packages/core/src/core/rstest.ts | Changed environment variable check logic to enable ES modules by default (two occurrences) |
| e2e/watch/shortcuts.test.ts | Updated test fixture path logic to match new default behavior (two occurrences) |
| e2e/watch/restart.test.ts | Updated test fixture path logic to match new default behavior |
| e2e/watch/index.test.ts | Updated test fixture path logic to match new default behavior |
| e2e/mock/tests/mock.test.ts | Updated conditional test logic to match new default behavior |
| e2e/externals/interop.test.ts | Updated test arguments logic to match new default behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Change the default output format from CommonJS to ES module format for Rstest.
This change makes ES modules the default module system, aligning with modern JavaScript standards.
Users can still opt-in to CommonJS format by explicitly setting
output.moduleto false.This change will make Rstest run more stably and avoid test failures due to issues with externalizing CommonJS modules.
close: #638
Checklist