-
Notifications
You must be signed in to change notification settings - Fork 29.1k
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
test: refactor test-runner-module-mocking
#54233
test: refactor test-runner-module-mocking
#54233
Conversation
Review requested:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #54233 +/- ##
==========================================
- Coverage 87.10% 87.10% -0.01%
==========================================
Files 647 647
Lines 181739 181739
Branches 34887 34886 -1
==========================================
- Hits 158310 158301 -9
- Misses 16738 16740 +2
- Partials 6691 6698 +7 |
cjsImpl = require(cjsFixture); | ||
|
||
assert.strictEqual(esmImpl.default.string, 'original cjs string'); | ||
assert.strictEqual(cjsImpl.string, 'original cjs string'); | ||
}); | ||
|
||
test('ESM mocks can be used by both module systems', async (t) => { |
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.
Why remove this test? (Other changes LGTM)
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.
I couldn't find a way to refactor it. Either we use an absolute path for require
and a file: URL for import()
(but that's already the previous test), either we use the same relative specifier (but that's already the following test); so it seemed to me it was testing a "real" use case, or rather it's testing some particular case where an absolute path coincides with an origin-relative URL – but we cannot guarantee that, it depends on where the node repo was cloned.
90b5261
to
8ef4cb9
Compare
Landed in 9e6c526 |
PR-URL: #54233 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Trying to use paths as import specifiers can lead to weird results if the path contain special URL chars (e.g.
#
,?
,%
).