-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
68 lines (65 loc) · 1.78 KB
/
vitest.config.ts
File metadata and controls
68 lines (65 loc) · 1.78 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import { playwright } from '@vitest/browser-playwright'
import { defineConfig } from 'vitest/config'
declare module 'vitest' {
export interface ProvidedContext {
withNodeWorkaround: (boolean | undefined)[]
}
}
export default defineConfig({
test: {
coverage: {
// See https://github.com/marketplace/actions/vitest-coverage-report
// you can include other reporters, but 'json-summary' is required, json is recommended
reporter: ['text', 'json-summary', 'json'],
// If you want a coverage reports even if your tests are failing, include the reportOnFailure option
reportOnFailure: true,
},
projects: [
{
test: {
name: 'node',
environment: 'node',
globals: true,
provide: {
withNodeWorkaround: [true],
},
include: ['test/**/*.test.ts'],
},
},
{
test: {
name: 'browser',
browser: {
enabled: true,
provider: playwright(),
headless: true,
screenshotFailures: false,
// https://vitest.dev/guide/browser/playwright
instances: [
{ browser: 'chromium' },
{ browser: 'firefox' },
// webkit is not working on my machine
// { browser: 'webkit' },
],
},
globals: true,
provide: {
withNodeWorkaround: [true, false, undefined],
},
include: ['test/**/*.test.ts'],
},
},
{
test: {
name: 'examples',
environment: 'node',
globals: true,
provide: {
withNodeWorkaround: [true],
},
include: ['examples/**/*.test.ts'],
},
},
],
},
})