yarn install
yarn test
- See error:
The argument 'path' must be a string or Uint8Array without null bytes. Received '\x00react/jsx-runtime'
- Set
registerNodeLoader
tofalse
invite.config.ts
yarn test
- It works now
Some react packages such as react-dnd
has required react/jsx-runtime
. And, @vitejs/plugin-react-refresh
will inject HMR code when react/jsx-runtime
is imported. But vitest's esm loader doesn't resolve this edge case.
Run vscode debug task Debug current Test File
with ./example.test.tsx
as the current file.
Add breakpoint in node_modules/vitest/dist/loader.js
line 34.