Skip to content
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

move vitest config to vite config #822

Merged
merged 2 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.