-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7b89bb5
commit 45dd5c2
Showing
3 changed files
with
48 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import tsconfigPaths from "vite-tsconfig-paths" | ||
import { defineConfig } from "vitest/config" | ||
|
||
export default defineConfig({ | ||
plugins: [tsconfigPaths()], | ||
test: { | ||
globals: true, | ||
css: true, | ||
root: "app", | ||
coverage: { | ||
all: false, | ||
reporter: ["text", "json-summary", "json"], | ||
reportOnFailure: true, | ||
}, | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,38 @@ | ||
import { defineConfig, defineWorkspace } from "vitest/config" | ||
import { defineWorkspace } from "vitest/config" | ||
|
||
import tsconfigPaths from "vite-tsconfig-paths" | ||
|
||
const serverTestConfig = defineConfig({ | ||
plugins: [tsconfigPaths()], | ||
test: { | ||
name: "server tests", | ||
globals: true, | ||
css: true, | ||
environment: "node", | ||
include: ["./app/**/*.server.test.{ts,tsx}"], | ||
coverage: { | ||
include: ["./app/**/*"], | ||
reporter: ["text", "json-summary", "json"], | ||
reportOnFailure: true, | ||
export default defineWorkspace([ | ||
{ | ||
extends: "./vitest.config.ts", | ||
test: { | ||
name: "server tests", | ||
environment: "node", | ||
include: ["./**/*.server.test.{ts,tsx}"], | ||
}, | ||
}, | ||
}) | ||
|
||
const browserTestConfig = defineConfig({ | ||
plugins: [tsconfigPaths()], | ||
optimizeDeps: { | ||
include: ["react/jsx-dev-runtime"], | ||
}, | ||
server: { | ||
fs: { | ||
strict: false, | ||
{ | ||
extends: "./vitest.config.ts", | ||
optimizeDeps: { | ||
include: ["react/jsx-dev-runtime"], | ||
}, | ||
}, | ||
test: { | ||
globals: true, | ||
css: true, | ||
includeTaskLocation: true, | ||
include: ["./**.test.{ts,tsx}", "!./**.server.test.{ts,tsx}"], | ||
setupFiles: ["./tests/setup.browser.tsx"], | ||
coverage: { | ||
include: ["./app/**/*"], | ||
reporter: ["text", "json-summary", "json"], | ||
reportOnFailure: true, | ||
server: { | ||
fs: { | ||
strict: false, | ||
}, | ||
}, | ||
|
||
name: "browser tests", | ||
browser: { | ||
// biome-ignore lint/nursery/noProcessEnv: we want to use process.env here | ||
headless: !!process.env.CI, | ||
enabled: true, | ||
name: "chromium", | ||
provider: "playwright", | ||
|
||
// https://playwright.dev | ||
providerOptions: {}, | ||
test: { | ||
includeTaskLocation: true, | ||
include: ["./**.test.{ts,tsx}", "!./**.server.test.{ts,tsx}"], | ||
setupFiles: ["./tests/setup.browser.tsx"], | ||
name: "browser tests", | ||
browser: { | ||
// biome-ignore lint/nursery/noProcessEnv: we want to use process.env here | ||
headless: !!process.env.CI, | ||
enabled: true, | ||
name: "chromium", | ||
provider: "playwright", | ||
// https://playwright.dev | ||
providerOptions: {}, | ||
}, | ||
}, | ||
}, | ||
}) | ||
|
||
export default defineWorkspace([serverTestConfig, browserTestConfig]) | ||
]) |