-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvitest.config.ts
31 lines (30 loc) · 1.09 KB
/
vitest.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
import GithubActionsReporter from "vitest-github-actions-reporter";
import { defineConfig, coverageConfigDefaults } from "vitest/config";
export default defineConfig({
test: {
/* `restoreMocks` accomplishes the following:
- clears all spies of `spy.mock.calls` and `spy.mock.results` (same as clearMocks:true)
- removes any mocked implementations (same as mockReset:true)
- restores the original implementation so fns don't return undefined like with mockReset */
restoreMocks: true,
globals: true,
silent: true,
hideSkippedTests: true,
environment: "node",
include: ["**/?(*.){test,spec}.?(c|m)[tj]s?(x)"],
reporters: ["default", ...(process.env.GITHUB_ACTIONS ? [new GithubActionsReporter()] : [])],
coverage: {
include: ["src/**/*.{js,ts}"],
exclude: [
...coverageConfigDefaults.exclude,
"**/tests/**/*",
"**/__mocks__/**/*",
"__mocks__/**/*",
],
reporter: [
...coverageConfigDefaults.reporter,
"json-summary", // <-- used by vitest-coverage-report GitHub Action
],
},
},
});