Skip to content

Conversation

@9aoy
Copy link
Contributor

@9aoy 9aoy commented Oct 21, 2025

Summary

add test case: should load external module singleton

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings October 21, 2025 09:03
@netlify
Copy link

netlify bot commented Oct 21, 2025

Deploy Preview for rstest-dev ready!

Name Link
🔨 Latest commit 7b9e8b3
🔍 Latest deploy log https://app.netlify.com/projects/rstest-dev/deploys/68f74d52aba2460008d31196
😎 Deploy Preview https://deploy-preview-635--rstest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

Copilot AI left a 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.js in node_modules with 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 (CB1)

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

Copilot AI Oct 21, 2025

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.

Suggested change
let c = undefined;
let c = null;

Copilot uses AI. Check for mistakes.
fs.writeFileSync(
join(__dirname, 'fixtures', 'node_modules', 'c.js'),
`
let c = undefined;
Copy link

Copilot AI Oct 21, 2025

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.

Suggested change
let c = undefined;
let c = undefined;

Copilot uses AI. Check for mistakes.
@9aoy 9aoy merged commit 0814e01 into main Oct 21, 2025
19 checks passed
@9aoy 9aoy deleted the test-singleton branch October 21, 2025 09:17
@9aoy 9aoy mentioned this pull request Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants