Skip to content

Commit 7c6ad85

Browse files
committed
Added test coverage collection for Jest.
1 parent c18ca0c commit 7c6ad85

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

jest.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,7 @@ module.exports = {
2929
'<rootDir>/web/themes/',
3030
'<rootDir>/.vortex/',
3131
],
32+
collectCoverageFrom: ['web/modules/custom/**/js/**/*.js', '!**/*.test.js'],
33+
coverageReporters: ['text', 'lcov', 'html', ['cobertura', { file: 'cobertura.xml' }]],
34+
coverageDirectory: '.logs/coverage/jest',
3235
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"lint-fix-js": "eslint web/modules/custom --ext .js --no-error-on-unmatched-pattern --fix",
1515
"lint-fix-css": "stylelint --allow-empty-input \"web/modules/custom/**/*.css\" --fix",
1616
"lint-fix": "yarn run lint-fix-js && yarn run lint-fix-css",
17-
"test": "jest"
17+
"test": "jest --coverage"
1818
},
1919
"devDependencies": {
2020
"@homer0/prettier-plugin-jsdoc": "^11.0.1",

0 commit comments

Comments
 (0)