-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
fix: migrate from tap to node test and c8 #248
Conversation
28934ea
to
c070d9b
Compare
c070d9b
to
dc5d22e
Compare
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.
If the taprc file did not contain disable-coverage: true, please enable c8 coverage; for how, see my suggested change
test/bundlers.test.js
Outdated
const fp = require('../plugin') | ||
|
||
test('webpack removes require.main.filename', (t) => { | ||
test('webpack removes require.main.filename', 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 have all of the test function been refactored to async functions?
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.
@jsumners Thank you for your question. You are right to notice that all test functions have been converted to async functions. While it's not strictly necessary for the migration from tap
to node:test
, I chose to do so due to these reasons:
- Consistency - It provides a uniform pattern across all tests.
- Future-proofing - It allows for easier integration of async operations in the future if needed.
- Minimal impact: The change doesn't negatively affect the tests' functionality or performance.
However, if the team prefers to keep the tests as close to the original implementation as possible, we can certainly revert this change and only use async functions where necessary.
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.
Unless there is a need for the functions to be async, please do not make them so.
916a3a6
to
72cd887
Compare
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.
lgtm
no strong opinions about #248 (comment)
I agree with @jsumners . It doesnt make any sesnse and has no benefit of making functions async if there is nothing to be awaited etc.. So yes, please remove unnecesasry async. |
comments addressed |
457c1fd
to
e2b7a88
Compare
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.
lgtm
Checklist
This PR replaces tap with node:test for testing and adds c8 for coverage.
npm run test
andnpm run benchmark
and the Code of conduct