-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Use node:test and node:assert/strict #9649
Conversation
|
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'm for this! I think node:test
is likely to become better "quickly" and will in the future have a fair ecosystem around it, by being the built-in option. I trust in Node 🫡
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.
How would it work if I wanted to run a single test? node test ../path/to/file.test.js
?
Almost yeah! It's |
* feat(i18n): disable redirect * feat(i18n): add option to disable redirect to default language * chore: add schema validation * docs * changeset * Update packages/astro/src/core/config/schema.ts Co-authored-by: Bjorn Lu <[email protected]> * chore: address feedback * fix test * Update .changeset/cyan-grapes-suffer.md Co-authored-by: Sarah Rainsberger <[email protected]> * Update packages/astro/src/@types/astro.ts Co-authored-by: Sarah Rainsberger <[email protected]> * Fix discord fetch code (#9663) * Force re-execution of Partytown's head snippet on view transitions (#9666) * Remove the header script before a view transition takes place to force a reload on the next page * Add changeset * Save another char * [ci] format * fix(assets): Implement all hooks in the passthrough image service (#9668) * fix(assets): Implement all hooks in the passthrough image service * chore: changeset * refactor(toolbar): Rename every internal reference of overlay/plugins to toolbar/apps (#9647) * refactor(toolbar): Rename every internal reference of overlay/plugins to toolbar/apps * refactor: rename vite plugin * fix: update import * nit: add setting fallback * Disable file watcher for internal one-off vite servers (#9665) * Use node:test and node:assert/strict (#9649) * [ci] format * fix(i18n): emit an error when the index isn't found (#9678) * fix(i18n): emit an error when the index isn't found * changeset * Update .changeset/proud-guests-bake.md Co-authored-by: Sarah Rainsberger <[email protected]> * rename * Update packages/astro/src/core/errors/errors-data.ts Co-authored-by: Florian Lefebvre <[email protected]> --------- Co-authored-by: Sarah Rainsberger <[email protected]> Co-authored-by: Florian Lefebvre <[email protected]> * feat(i18n): add option to disable redirect to default language * chore: rebase * Update packages/astro/src/@types/astro.ts Co-authored-by: Bjorn Lu <[email protected]> * lock file update --------- Co-authored-by: Bjorn Lu <[email protected]> Co-authored-by: Sarah Rainsberger <[email protected]> Co-authored-by: Martin Trapp <[email protected]> Co-authored-by: Martin Trapp <[email protected]> Co-authored-by: Erika <[email protected]> Co-authored-by: Bjorn Lu <[email protected]> Co-authored-by: Florian Lefebvre <[email protected]>
Changes
For
@astrojs/upgrade
only for now as an experiment. There are quite some quirks withnode:test
:--test-name-pattern
with it. Test runner cannot find tests in multiple levels when using ** in tha path nodejs/node#50287.only
tests requires the--test-only
flag. If you have nested tests, e.g. describe > it, you need both to bedescribe.only
andit.only
:((Hence I created a wrapper
astro-scripts test
CLI which should simplify these. Except no2's nested --only issue.Testing
Tested manually with node 18.18.1 and node 20.6.1. Node 20 has slightly better test report description.
Performance-wise, running
time pnpm test
:pnpm test 0.89s user 0.21s system 167% cpu 0.659 total
pnpm test 0.54s user 0.08s system 89% cpu 0.687 total
Docs
n/a. internal change.