Skip to content

Commit

Permalink
move vitest config to vite config (#822)
Browse files Browse the repository at this point in the history
  • Loading branch information
kentcdodds authored Aug 27, 2024
1 parent 4e7c2cf commit d3d6103
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 40 deletions.
56 changes: 35 additions & 21 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,31 @@ export default defineConfig({
},
plugins: [
envOnlyMacros(),
remix({
ignoredRouteFiles: ['**/*'],
serverModuleFormat: 'esm',
routes: async (defineRoutes) => {
return flatRoutes('routes', defineRoutes, {
ignoredRouteFiles: [
'.*',
'**/*.css',
'**/*.test.{js,jsx,ts,tsx}',
'**/__*.*',
// This is for server-side utilities you want to colocate
// next to your routes without making an additional
// directory. If you need a route that includes "server" or
// "client" in the filename, use the escape brackets like:
// my-route.[server].tsx
'**/*.server.*',
'**/*.client.*',
],
})
},
}),
// it would be really nice to have this enabled in tests, but we'll have to
// wait until https://github.com/remix-run/remix/issues/9871 is fixed
process.env.NODE_ENV === 'test'
? null
: remix({
ignoredRouteFiles: ['**/*'],
serverModuleFormat: 'esm',
routes: async (defineRoutes) => {
return flatRoutes('routes', defineRoutes, {
ignoredRouteFiles: [
'.*',
'**/*.css',
'**/*.test.{js,jsx,ts,tsx}',
'**/__*.*',
// This is for server-side utilities you want to colocate
// next to your routes without making an additional
// directory. If you need a route that includes "server" or
// "client" in the filename, use the escape brackets like:
// my-route.[server].tsx
'**/*.server.*',
'**/*.client.*',
],
})
},
}),
process.env.SENTRY_AUTH_TOKEN
? sentryVitePlugin({
disable: MODE !== 'production',
Expand All @@ -76,4 +80,14 @@ export default defineConfig({
})
: null,
],
test: {
include: ['./app/**/*.test.{ts,tsx}'],
setupFiles: ['./tests/setup/setup-test-env.ts'],
globalSetup: ['./tests/setup/global-setup.ts'],
restoreMocks: true,
coverage: {
include: ['app/**/*.{ts,tsx}'],
all: true,
},
},
})
19 changes: 0 additions & 19 deletions vitest.config.ts

This file was deleted.

0 comments on commit d3d6103

Please sign in to comment.