refactor: migrate to node:test and setup jsdom environment#5667
Draft
bjohansebas wants to merge 2 commits intonextfrom
Draft
refactor: migrate to node:test and setup jsdom environment#5667bjohansebas wants to merge 2 commits intonextfrom
bjohansebas wants to merge 2 commits intonextfrom
Conversation
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.
1f3bae9 to
3286583
Compare
Codecov Report✅ All modified and coverable lines are covered by tests.
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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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