generated from obsidianmd/obsidian-sample-plugin
-
Notifications
You must be signed in to change notification settings - Fork 190
/
jest.config.js
47 lines (44 loc) · 1.33 KB
/
jest.config.js
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
/** @type {import('@ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
verbose: true,
preset: "ts-jest",
testEnvironment: "jsdom",
setupFilesAfterEnv: ["jest-expect-message"],
moduleNameMapper: {
"src/(.*)": "<rootDir>/src/$1",
},
moduleFileExtensions: ["js", "jsx", "ts", "tsx", "json", "node", "d.ts"],
roots: ["<rootDir>/src/", "<rootDir>/tests/unit/"],
collectCoverageFrom: ["src/**"],
coveragePathIgnorePatterns: [
// node modules & build output
"build/",
"node_modules/",
// GUI & Obsidian coupled code
"src/core.ts",
"src/file.ts",
"src/gui/",
"src/icons/",
"src/main.ts",
"src/next-note-review-handler.ts",
"src/plugin-data.ts",
"src/utils/renderers.ts",
// debugging utils
"src/utils/debug.ts",
// don't include in results
"src/declarations.d.ts",
"src/lang/locale/",
],
coverageDirectory: "coverage",
collectCoverage: true,
coverageProvider: "v8",
coverageThreshold: {
global: {
// TODO: Bring coverage back up to 98%+
// TODO: Figure out why coverage on the GitHub runner
// is lower than the local coverage
statements: 92,
branches: 88,
},
},
};