Repository navigation
Expand file tree
/
Copy pathvitest.config.ts
More file actions
50 lines (49 loc) · 1.6 KB
/
Copy pathvitest.config.ts
File metadata and controls
50 lines (49 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import { defineConfig } from 'vitest/config'
export default defineConfig({
oxc: { tsconfig: false } as never,
test: {
projects: [
{
test: {
name: 'unit',
include: ['test/**/*.test.ts', 'modules/**/*.test.ts', 'scripts/**/*.test.mjs'],
exclude: ['test/e2e/**', 'test/vercel/**', 'test/smoke/**'],
setupFiles: ['test/setup.ts'],
environment: 'node',
},
},
{
// Runs against the built playground (`pnpm build`), so it catches what only breaks once bundled.
test: {
name: 'e2e',
include: ['test/e2e/**/*.test.ts'],
globalSetup: ['test/e2e/setup.ts'],
environment: 'node',
// A cold page pulls its content from GitHub and OG images render through satori.
testTimeout: 60_000,
},
},
{
// Reads the Vercel build output (`NITRO_PRESET=vercel pnpm build`), checking what a deploy would get.
test: {
name: 'vercel',
include: ['test/vercel/**/*.test.ts'],
environment: 'node',
},
},
{
// The e2e suite against a deployment (`SMOKE_URL`), plus what only Vercel can answer.
test: {
name: 'smoke',
include: ['test/e2e/**/*.test.ts', 'test/smoke/**/*.test.ts'],
// Reads the local build output, which a deployment does not have.
exclude: ['test/e2e/bundle.test.ts'],
globalSetup: ['test/smoke/setup.ts'],
environment: 'node',
// Cold starts included.
testTimeout: 60_000,
},
},
],
},
})