-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvitest.config.ts
More file actions
50 lines (49 loc) · 1.69 KB
/
Copy pathvitest.config.ts
File metadata and controls
50 lines (49 loc) · 1.69 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 { defineVitestConfig } from '@stencil/vitest/config';
import { playwright } from '@vitest/browser-playwright';
export default defineVitestConfig({
stencilConfig: './stencil.config.ts',
test: {
coverage: {
provider: 'v8',
include: ['src/context/**/*.{ts,tsx}'],
},
projects: [
// Unit tests - node environment for functions / logic
{
test: {
name: 'unit',
include: ['src/tests/**/*.unit.{ts,tsx}'],
environment: 'node',
},
},
// Spec tests - via a node DOM of your choice
{
test: {
name: 'spec',
include: ['src/tests/**/*.spec.{ts,tsx}'],
environment: 'stencil',
setupFiles: ['./vitest-setup.ts'],
environmentOptions: {
stencil: {
domEnvironment: 'mock-doc',
},
},
},
},
// Browser tests
{
test: {
name: 'browser',
include: ['src/tests/**/*.test.{ts,tsx}'],
setupFiles: ['./vitest-setup.ts'],
browser: {
enabled: true,
provider: playwright(),
headless: true,
instances: [{browser: 'chromium'}],
},
},
},
],
},
});