From e0262b5d3df9fe23c50eaa9ce3ca6d35aa4c6b31 Mon Sep 17 00:00:00 2001 From: Parker Mauney Date: Tue, 11 Jun 2019 17:23:24 -0500 Subject: [PATCH 1/2] Use jest config for test discovery --- jest.config.js | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/jest.config.js b/jest.config.js index cf54460..a77f57b 100644 --- a/jest.config.js +++ b/jest.config.js @@ -133,10 +133,10 @@ module.exports = { // testLocationInResults: false, // The glob patterns Jest uses to detect test files - // testMatch: [ - // "**/__tests__/**/*.js?(x)", - // "**/?(*.)+(spec|test).js?(x)" - // ], + testMatch: [ + "**/__tests__/**/*.js?(x)", + "**/?(*.)+(spec|test).js?(x)" + ], // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped // testPathIgnorePatterns: [ diff --git a/package.json b/package.json index 29195db..cb69534 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "start": "node server.js", "start-nodemon": "nodemon --ignore cache/ server.js", "lint": "eslint *.js app/routes/*.js", - "test": "jest --coverage test/*.test.js && npm run lint" + "test": "jest --coverage && npm run lint" }, "dependencies": { "@octokit/rest": "^16.6.1", From d3217be15e3c3319181bb968e2fdfaaa32cf1eb6 Mon Sep 17 00:00:00 2001 From: Parker Mauney Date: Tue, 11 Jun 2019 17:24:49 -0500 Subject: [PATCH 2/2] Ignore mockCache.js in coverage report --- .gitignore | 1 + jest.config.js | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 273ada7..0fd57b2 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ auth/ regression-data/ nodejs_dc.log nodejs_restclient.log +coverage/ diff --git a/jest.config.js b/jest.config.js index a77f57b..a577b9f 100644 --- a/jest.config.js +++ b/jest.config.js @@ -27,9 +27,10 @@ module.exports = { // coverageDirectory: null, // An array of regexp pattern strings used to skip coverage collection - // coveragePathIgnorePatterns: [ - // "/node_modules/" - // ], + coveragePathIgnorePatterns: [ + "/node_modules/", + "/test/mockCache.js", + ], // A list of reporter names that Jest uses when writing coverage reports // coverageReporters: [