-
Notifications
You must be signed in to change notification settings - Fork 19
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
node:test
support
#308
node:test
support
#308
Conversation
node:test's default reporter is really limted, and doesn't print the errors that earl generates in a nice way. I replaced it with a better one, which behaves like mocha.
🦋 Changeset detectedLatest commit: 9680303 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -8,7 +8,7 @@ jobs: | |||
CI: | |||
strategy: | |||
matrix: | |||
node: ["16.x", "18.x"] | |||
node: ["18.x", "20.x", "22.x"] |
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.
The reason for the change is that 16 is EOL'ed, and I believe it doesn't support node:test
.
Also added 20 and 22 to make sure it works with them.
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.
node:test
is much better in 22. It was more experimental in the previous versions.
@@ -10,11 +10,13 @@ | |||
"lint": "biome check ./src", | |||
"lint:fix": "biome check --apply ./src", | |||
"typecheck": "tsc --noEmit", | |||
"test": "node --test --loader ts-node/esm src/*.test.ts", | |||
"test": "node --test --test-reporter=@voxpelli/node-test-pretty-reporter --loader ts-node/esm src/*.test.ts", |
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.
This uses this other reporter, which takes advantage of the errors that earl generates to print a diff: https://github.com/voxpelli/node-test-pretty-reporter
I think this should be documented.
ebee8f2
to
00384a8
Compare
00384a8
to
0ea81c4
Compare
0ea81c4
to
c3d5ddd
Compare
I understand what the last TODO item means now. I believe it may come from not using project references and tsc getting somewhat lost. From a separate npm project things work as expected. |
I can try to fix this, but would like to validate it with you first, as it would touch most |
No, it's not that. The problem is that the |
6c2c8ad
to
385b16e
Compare
385b16e
to
bc4ccdb
Compare
bc4ccdb
to
5425e8c
Compare
@alcuadrado Great work. Sorry I couldn't look at this earlier, I was really busy with conferences. I'll try to review this week and hopefully get this merged and released. |
* Support snapshots in node:test * Sort imports * `node:test` support (#308) * Update the ci to run in the maintained versions of node * Remove unused stuff from the node:test example * Update the node:test example with a better reporter node:test's default reporter is really limted, and doesn't print the errors that earl generates in a nice way. I replaced it with a better one, which behaves like mocha. * Fix stack trace test * Use glob -c in the node:test example * Fix file:// URLs handling * Fix example plugin * Add changeset * Mention node:test in documentation --------- Co-authored-by: Patricio Palladino <email@patriciopalladino.com> Co-authored-by: Mateusz Radomski <radomski.main@protonmail.com>
LFG! 🚀 I'll send an PR updating the readme and docs to reflect this. Small note @mateuszradomski, you forgot to tag the release here on GH. |
Hey @sz-piotr,
I continued your work on #305 in this PR.
Your previous TODO:
examples/example-node-runner
What does the last todo item mean? I'm willing to fix it if you explain it.
Also, can I add info about
node:test
to the readme and the docs?I really really think this library +
node:test
are a great combo