Skip to content

Commit f58f362

Browse files
ParkerMkarianna
authored andcommitted
Fix npm test file matching on Windows (#169)
* Use jest config for test discovery * Ignore mockCache.js in coverage report
1 parent de5ae5c commit f58f362

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ auth/
55
regression-data/
66
nodejs_dc.log
77
nodejs_restclient.log
8+
coverage/

jest.config.js

+8-7
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ module.exports = {
2727
// coverageDirectory: null,
2828

2929
// An array of regexp pattern strings used to skip coverage collection
30-
// coveragePathIgnorePatterns: [
31-
// "/node_modules/"
32-
// ],
30+
coveragePathIgnorePatterns: [
31+
"/node_modules/",
32+
"/test/mockCache.js",
33+
],
3334

3435
// A list of reporter names that Jest uses when writing coverage reports
3536
// coverageReporters: [
@@ -133,10 +134,10 @@ module.exports = {
133134
// testLocationInResults: false,
134135

135136
// The glob patterns Jest uses to detect test files
136-
// testMatch: [
137-
// "**/__tests__/**/*.js?(x)",
138-
// "**/?(*.)+(spec|test).js?(x)"
139-
// ],
137+
testMatch: [
138+
"**/__tests__/**/*.js?(x)",
139+
"**/?(*.)+(spec|test).js?(x)"
140+
],
140141

141142
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
142143
// testPathIgnorePatterns: [

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"start": "node server.js",
1818
"start-nodemon": "nodemon --ignore cache/ server.js",
1919
"lint": "eslint *.js app/routes/*.js",
20-
"test": "jest --coverage test/*.test.js && npm run lint"
20+
"test": "jest --coverage && npm run lint"
2121
},
2222
"dependencies": {
2323
"@octokit/rest": "^16.6.1",

0 commit comments

Comments
 (0)