forked from PalisadoesFoundation/talawa-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
49 lines (41 loc) · 1.75 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
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
setupFiles: ["./setupFile.ts"],
// Run the setup and teardown scripts before and after all the tests are run
// The scripts are used to clear the testing database of all the data.
// The function names `setup` and `teardown` are special because vitest
// specifically looks for those functions in the `globalSetup.ts` file.
// More info here https://vitest.dev/config/#globalsetup
globalSetup: ["./tests/helpers/globalSetup.ts"],
coverage: {
// This tells vitest to include all files from ./src in test coverage.
all: true,
// This tells vitest the directory to get coverage for.
include: ["src/"],
// This tells vitest the files/directories to exclude from the coverage.
// This is intentionally done because coverage for these files doesn't
// provide any meaningful details for coverage report.
exclude: [
"src/config",
"src/models",
"src/typeDefs",
"src/types",
"src/constants.ts",
"src/db.ts",
"src/server.ts",
"src/**/index.ts",
],
// This is used to tell vitest which coverage provider to use. c8 is the newer and
// recommended coverage provider for node.js applications. You can swap it with
// istanbul as well.
provider: "c8",
// This tells vitest in what format the report will be generated. Here lcov
// is selected because a file named lcov.info is generated by this reporter which
// is used in codecov/codecov-action github action for talawa-api.
reporter: ["lcov", "text"],
},
// Tells vitest the time limit for an individual test block run.
testTimeout: 30000,
},
});