-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
test: migrate jest -> node:test #6129
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
hummmm something strange I din't get any error for other test (not migrated yet). |
Wdym? Is it not generating junit.xml when passing the right args? |
@@ -91,10 +92,6 @@ | |||
"@storybook/addon-themes": "^7.5.3", | |||
"@storybook/addon-viewport": "~7.5.3", | |||
"@storybook/nextjs": "~7.5.3", | |||
"@testing-library/jest-dom": "~6.1.4", | |||
"@testing-library/react": "~14.0.0", | |||
"@testing-library/user-event": "~14.5.1", |
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 removed testing-library/user-event, are we not using them?
Afaik testing-library is used for react testing... and we need it to create the jsdom environment also...
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 have remove everything to start and re-add with we will need
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.
Not sure that's a good idea, but hey you do you.
on terminal it's doesn't output any error but on junit.xml it's write error. Alors if I remove |
huston we go a problem. TSX loader doesn't support jsx REF |
Afaik it does... Why do you think it doesn't? It should support React natively :) I even have seen users using it with React in the past (I also used it with React in the past, so I wonder what errors you're hitting?) |
@ovflowd I think there's been a misunderstanding. tsx and tsc are loaders that allow you to interpret typescript. But neither of them understands JSX. That's why I looked at |
Again, you're wrong. |
gotcha !!! |
If you're still struggling, please feel free to share errors. We're here to help. |
Any progress over here? 👀 |
I'ill come back in now I have time 😀 |
I'm getting trouble with react test. |
Can you share the errors? |
I think we truly dont care about css imports; So probably we should stub/mock these imports... I know esbuild supports css and probably css modules by default, but I doubt it is something we really want to import. |
@nodejs/loaders does anyone here know how we can stub/mock part of the module resolution process? More specifically some of our files import .css files but we definitely dont want to load them with the Node.js Test Runner (node:test) and we're using "--import=tsx" that adds a loader for TypeScript and React (JSX). Should we make another loader just to stub these CSS imports or is there something else we can do here? Like a builtin functionality to simply stub these imports? |
I think I found a solution for my own question. https://github.com/coderaiser/mock-import 👆 this might help you, Augustin. |
(Im also assuming https://www.npmjs.com/package/sinon can do the trick) as the state of node:test mocking and spying is kinda supbar atm (the whole thing is still experimental. We could definitely raise a feature request on node core cc @nodejs/test_runner) |
I use Testdouble to do this in a pure ESM environment. |
Lots of git conflicts are listed below... |
Closing because it's too old. And I can't rebase GitHub desktop just crash. |
Description
Migrate jest to nodejs internal test runer
Validation
all test should pass
Related Issues
#6123
Check List
npx turbo lint
to ensure the code follows the style guide. And runnpx turbo lint:fix
to fix the style errors if necessary.npx turbo format
to ensure the code follows the style guide.npx turbo test
to check if all tests are passing.