Skip to content

refactor: migrate to node:test and setup jsdom environment#5667

Draft
bjohansebas wants to merge 2 commits intonextfrom
migrate-jest-to-node-test-runner
Draft

refactor: migrate to node:test and setup jsdom environment#5667
bjohansebas wants to merge 2 commits intonextfrom
migrate-jest-to-node-test-runner

Conversation

@bjohansebas
Copy link
Copy Markdown
Member

Summary

What kind of change does this PR introduce?

Did you add tests for your changes?

Does this PR introduce a breaking change?

If relevant, what needs to be documented once your changes are merged or what have you already documented?

Use of AI

@bjohansebas bjohansebas marked this pull request as draft May 2, 2026 00:17
@alexander-akait
Copy link
Copy Markdown
Member

Looks like test are failed...

- Introduced a new script for node test setup (`scripts/node-test-setup.mjs`) to configure snapshot serializers and resolve snapshot paths for webpack tests.
- Added new npm script `test:node` in `package.json` for running node tests with specific configurations.
- Updated Jest snapshots in `proxy-option.test.js.snap.webpack5` to reflect changes in test descriptions.
- Refactored tests in `open-option.test.js` and `proxy-option.test.js` to utilize `jest-mock` for mocking and spying, replacing previous Jest mocking methods.
- Changed `beforeAll` and `afterAll` hooks to `before` and `after` for better test isolation and readability.
…tructure

- Changed snapshot test descriptions to include a more structured format.
- Updated snapshot assertions to use `t.assert.snapshot` for consistency.
- Refactored test setup and teardown methods to use `before` and `after` from `node:test`.
- Adjusted the test cases in `normalize-options.test.js` and `validate-options.test.js` for improved clarity and maintainability.
@bjohansebas bjohansebas force-pushed the migrate-jest-to-node-test-runner branch from 1f3bae9 to 3286583 Compare May 9, 2026 23:14
@codecov
Copy link
Copy Markdown

codecov Bot commented May 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.71%. Comparing base (a7ab30f) to head (3286583).

❗ There is a different number of reports uploaded between BASE (a7ab30f) and HEAD (3286583). Click for more details.

HEAD has 34 uploads less than BASE
Flag BASE (a7ab30f) HEAD (3286583)
36 2
Additional details and impacted files
@@             Coverage Diff             @@
##             next    #5667       +/-   ##
===========================================
- Coverage   83.73%   49.71%   -34.02%     
===========================================
  Files          11       11               
  Lines        1943     1943               
  Branches      719      720        +1     
===========================================
- Hits         1627      966      -661     
- Misses        283      810      +527     
- Partials       33      167      +134     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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