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.
This is a proof of concept intended to explore what it would look like
to use
node:test
andnode:assert
for testing. For the most part theassertions themselves translated nicely.
As part of the refactor, large fixtures were moved out of some test
files and into
./test/fixtures
.The parts that are probably not ready are:
also no way to set a coverage level requirement, nor is there
coverage mapping. This is the only repo left that the npm cli team
manages which still uses coverage mapping. Whether or not we want to
keep coverage mapping is a discussion that could take place.
This is Node.js's default, and can only apparently be changed from
tests that are invoked from
run()
.tap
for running the tests. Runningthe tests purely from node would require having a centralized runner,
or refactoring all the tests to invoke
run()
and set a timeout. Itwould also require solving the coverage problem.
Node.js test suite. There was only one test that really could
arguably benefit from it: the help output. The rest really were
better suited for explicit checks.
Conclusion:
node:test
is not feature complete, and we can not cut overto it fully. This PR may be ok to land as-is, since
node:test
returnstap-compatible results. Whether or not we want to land it like this is
a discussion to be had. At the very least this demonstrates the amount
of work needed to translate tests from
tap
tonode:test