-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.ts
56 lines (55 loc) · 1.87 KB
/
vite.config.ts
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
import { defineConfig } from 'vite';
import solid from 'vite-plugin-solid';
import tsconfigPaths from 'vite-tsconfig-paths';
import { configDefaults } from 'vitest/config';
export default defineConfig({
plugins: [tsconfigPaths(), solid()],
server: {
port: 5000,
},
test: {
// to see how your tests are running in real time in the terminal, add "default"
// to generate HTML output and preview the results of your tests, add "html"
reporters: ['default', 'html'],
environment: 'jsdom', // mocking the DOM API
globals: true, // use APIs globally like jest
setupFiles: ['src/setup-test.ts'],
exclude: [...configDefaults.exclude, 'e2e/*'],
// Will call .mockRestore() on all spies before each test. This will clear mock history and reset its implementation to the original one.
restoreMocks: true,
// otherwise, solid would be loaded twice:
deps: { registerNodeLoader: true },
// if you have few tests, try commenting one
// or both out to improve performance:
// threads: false,
// isolate: false,
coverage: {
provider: 'istanbul', // 'istanbul' / 'v8'
reporter: ['text', 'json', 'html'],
statements: 50,
branches: 50,
functions: 50,
lines: 50,
exclude: [
'coverage/**',
'dist/**',
'packages/*/test{,s}/**',
'**/*.d.ts',
'cypress/**',
'test{,s}/**',
'test{,-*}.{js,cjs,mjs,ts,tsx,jsx}',
'**/*{.,-}test.{js,cjs,mjs,ts,tsx,jsx}',
'**/*{.,-}spec.{js,cjs,mjs,ts,tsx,jsx}',
'**/__tests__/**',
'**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*',
'**/.{eslint,mocha,prettier}rc.{js,cjs,yml}',
// above is default
'src/setup-test.ts',
'src/index.tsx',
'src/mocks/**',
'src/assets/**',
'src/lib/**',
],
},
},
});