-
-
Notifications
You must be signed in to change notification settings - Fork 14
test: should load external module singleton #635
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 adds test coverage for external module singleton behavior by introducing a new test case that verifies external modules maintain singleton state across test files.
Key changes:
- Creates a synthetic external module
c.jsinnode_moduleswith singleton-like behavior - Updates test files to verify the external module's singleton state is preserved across different test scenarios
- Refactors existing test variable naming for clarity (
C→B1)
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| e2e/singleton/index.test.ts | Adds beforeAll hook to dynamically create external module c.js in node_modules |
| e2e/singleton/fixtures/setup.ts | Imports and initializes external module C in environment variables |
| e2e/singleton/fixtures/index1.test.ts | Adds test case for external module C singleton and renames variables |
| e2e/singleton/fixtures/index.test.ts | Adds test case for external module C singleton |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| fs.writeFileSync( | ||
| join(__dirname, 'fixtures', 'node_modules', 'c.js'), | ||
| ` | ||
| let c = undefined; |
Copilot
AI
Oct 21, 2025
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.
[nitpick] The variable c should be initialized as null instead of undefined for more explicit null checks, or use TypeScript's type system to ensure proper initialization patterns.
| let c = undefined; | |
| let c = null; |
| fs.writeFileSync( | ||
| join(__dirname, 'fixtures', 'node_modules', 'c.js'), | ||
| ` | ||
| let c = undefined; |
Copilot
AI
Oct 21, 2025
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.
The indentation for the export statement is inconsistent with the rest of the code. It should be aligned with line 17 (no leading spaces) to maintain consistent formatting.
| let c = undefined; | |
| let c = undefined; |
Summary
add test case: should load external module singleton
Related Links
Checklist