Skip to content

Commit cc7e1b6

Browse files
committed
added jest coverage
1 parent f9d5d21 commit cc7e1b6

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
node_modules
22
lib
3+
coverage
34

45
### VisualStudioCode Patch ###
56
# Ignore all local history of files

jest.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
/** @type {import("jest").Config} */
22
export default {
33
// verbose: true, // Uncomment for detailed test output
4+
collectCoverage: true,
5+
coverageDirectory: "coverage",
46
testEnvironment: "jsdom",
57
testEnvironmentOptions: {
68
customExportConditions: ["node"],
79
},
10+
testPathIgnorePatterns: ["/node_modules/", "/lib/"],
811
transform: {
912
"^.+\\.[tj]sx?$": ["babel-jest", { configFile: "./babel.config.js" }],
1013
},

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"lint": "eslint 'src/**/*.ts' 'test/**/*.ts'",
1313
"typecheck": "tsc --noEmit",
1414
"typecheck:test": "tsc --noEmit -p tsconfig.test.json",
15-
"test": "jest",
15+
"test": "jest --no-coverage",
16+
"test:coverage": "jest --coverage",
1617
"test-debug": "node --inspect-brk ./node_modules/.bin/jest -i --env jest-environment-node-debug",
1718
"prepublishOnly": "npm run build && npm run test",
1819
"preversion": "npm run lint && npm run typecheck && npm test",

0 commit comments

Comments
 (0)