How to mock virtual:react-router/server-build #7205
-
I'm working with RR7 and using a virtual module. I have read https://vitest.dev/guide/mocking#virtual-modules in the docs however the example there is with vitest.config.js. I am using a vite.config.test.ts. I'm running in to a few issues. The My project is based off https://github.com/remix-run/react-router-templates/tree/main/node-custom-server. You can see the import here https://github.com/remix-run/react-router-templates/blob/main/node-custom-server/server/app.ts#L16.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
If this is not working for your setup, can you provide a reproduction? |
Beta Was this translation helpful? Give feedback.
import { resolve } from "node:path"
should be correct. Here is an example https://stackblitz.com/edit/vitest-dev-vitest-w8nrf7qg?file=vite.config.tsIf this is not working for your setup, can you provide a reproduction?