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
☂️ Move Astro tests to node:test
#9873
Comments
node:test
node:test
Would love to contribute, I'd like to grab |
I would like to migrate tests of |
I'll try first with I know it's a core package, but it is a small one, so I thought it could start some discussion about progressively migrating the tests! |
I will take a hit on |
Working on |
I will take |
I will do |
It seems not, thank you for checking |
I think also |
Doing |
If there aren't any mocha tests, we can skip the package |
I will try with |
I will take on |
I will take a hit on |
I can take the |
This one is a brainteaser, if someone else could do this that would be super helpful 🙏 (looking at ya Voxel 👀 ) |
I will take the alias-**.test.js |
I'll take files that:
|
I'll take files that:
|
I will take |
I'll take files that start with |
so I'll take files that start with |
I made this files |
I'll take files that start with |
JUST MEMO If my checks are correct, the remaining tests are these:
|
I'll |
I'll take |
I'll take |
Description
Internally, the team decided to move our testing infrastructure to use
node:test
instead of Mocha.While Mocha is good, it has its own quirks. Also, we believe that the Node.js test runner will improve with time.
This is an excellent opportunity to contribute to Astro and help us with the migration because you don't need to understand Astro logic. So if you have been looking for an opportunity to contribute to Astro, this is the perfect chance for you!
Plan
Comment here which integration/adapter you want to migrate first. Failing to comment might nullify your contribution if someone else did the work and commented on the issue. This will help us to avoid having multiple people working on the same thing.
The plan should be as follows:
@astrojs/*
packages. This can be done in one PR, because we only have a few tests inside our integrations/adapters. You can use this PR as a blueprint of what we're looking for: chore(@astrojs/node): use Node.js for testing #9758Integrations/adapters
List of the integrations/adapters
@astrojs/vue
@astrojs/alpinejs
@astrojs/lit
@xMohamd@astrojs/markdoc
@astrojs/mdx
@astrojs/partytown
@astrojs/preact
@astrojs/react
@astrojs/sitemap
@astrojs/solid
@astrojs/svelte
@astrojs/tailwind
@astrojs/vercel
@mingjunluCore
astro
After #10002 is merged, we can progressively start migrating tests.
Instructions:
*.test.js
file to*.nodetest.js
, e.g.api.test.js
->api.nodetest.js
pnpm test:node
to run only the files that use Node.js test runnerWarning
Node.js test runner doesn't handler deep nested
describe,
so it's possible your test could hang and timeout. If that happens, lift thedescribe
function.External adapters
withastro/adapters#144
The text was updated successfully, but these errors were encountered: