Closed ericchernuka closed 1 year ago
did you change something in the config?
I see the something similar in Windows 11 when removing globals
for me the failing tests are in app/routes/users_+/__shared.basic-info.test.tsx
stderr | app/routes/users_+/__shared.basic-info.test.tsx > Link to chat is links to login if user is not logged in
[MSW] Warning: captured a request without a matching request handler:
• GET file:///C:/projects/kcd-apps/rocket-rental/node_modules/vitest/dist/entry.js
If you still wish to intercept this unhandled request, please create a request handler for it.
Read more: https://mswjs.io/docs/getting-started/mocks
[MSW] Warning: captured a request without a matching request handler:
• GET file:///C:/projects/kcd-apps/rocket-rental/node_modules/@vitest/runner/dist/index.js
If you still wish to intercept this unhandled request, please create a request handler for it.
Read more: https://mswjs.io/docs/getting-started/mocks
[MSW] Warning: captured a request without a matching request handler:
• GET c:///\projects\kcd-apps\rocket-rental\app\routes\users_+\__shared.basic-info.test.tsx
If you still wish to intercept this unhandled request, please create a request handler for it.
Read more: https://mswjs.io/docs/getting-started/mocks
[MSW] Warning: captured a request without a matching request handler:
• GET c:///\projects\kcd-apps\rocket-rental\node_modules\@testing-library\dom\dist\query-helpers.js
If you still wish to intercept this unhandled request, please create a request handler for it.
Read more: https://mswjs.io/docs/getting-started/mocks
[MSW] Warning: captured a request without a matching request handler:
• GET c:///\projects\kcd-apps\rocket-rental\node_modules\@testing-library\dom\dist\wait-for.js
If you still wish to intercept this unhandled request, please create a request handler for it.
Read more: https://mswjs.io/docs/getting-started/mocks
✓ app/utils/encryption.server.test.ts (3)
✓ app/routes/resources+/delete-image.test.tsx (4) 643ms
✓ app/routes/bookings+/$bookingId.test.tsx (6) 734ms
❯ app/routes/users_+/__shared.basic-info.test.tsx (4)
✓ Link to chat is a form if user is logged in, is not self, and no chat exists yet
✓ Link to chat is link to specific chat if logged in, not self, and there is a history
✓ Link to chat is link to all chats if viewing it myself along with edit profile link
| Link to chat is links to login if user is not logged in
✓ app/routes/ships_+/$shipId.book.test.tsx (2)
✓ app/routes/resources+/city-combobox.test.tsx (1) 562ms
import tsconfigPaths from 'vite-tsconfig-paths'
export default defineConfig({
plugins: [react(), tsconfigPaths()],
test: {
include: ['./app/**/*.test.{ts,tsx}'],
- globals: true,
environment: 'jsdom',
setupFiles: ['./tests/setup/setup-test-env.ts'],
globalSetup: ['./tests/setup/global-setup.ts'],
coverage: {
include: ['app/**/*.{ts,tsx}'],
all: true,
@kentcdodds,
maybe we are missing GET
handler in mocks\index.ts
Is this now resolved for you?
Not sure it was related, but the close-with-grace
was masking the lack of an env variable on my side.
I also logged an issue in MSW for all the warnings for file system files, https://github.com/mswjs/msw/issues/1630.
In my testing, the warnings seem all related to the use of unstable_createRemixStub
as we've seen in our organization's project also. The warnings only show up if something fails. In this case, if I didn't have the .env file, everything fails and MSW starts logging files.
I just cloned the repo and ran the tests, but Vitest ends up existing with many warnings from MSW regarding local files. Has anyone experienced this?
Running Node 18.16.0 (same as this repo's CI) on OSX 13.4.