Skip to content

Commit

Permalink
Merge pull request #300 from aVileBroker/dont-collect-coverage-by-def…
Browse files Browse the repository at this point in the history
…ault

Stop collecting coverage by default for jest tests
  • Loading branch information
aVileBroker committed Aug 24, 2021
2 parents e53cf5f + ba8b421 commit 36c396b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
19 changes: 7 additions & 12 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = {
clearMocks: true,

// Indicates whether the coverage information should be collected while executing the test
collectCoverage: true,
collectCoverage: false,

// An array of glob patterns indicating a set of files for which coverage information should be collected
collectCoverageFrom: [
Expand All @@ -39,10 +39,10 @@ module.exports = {
// A list of reporter names that Jest uses when writing coverage reports
coverageReporters: [
'json-summary',
'html',
// 'text',
// 'lcov',
// 'clover'
'html',
// 'text',
// 'lcov',
// 'clover'
],

// An object that configures minimum threshold enforcement for coverage results
Expand Down Expand Up @@ -137,9 +137,7 @@ module.exports = {
// setupFiles: [],

// A list of paths to modules that run some code to configure or set up the testing framework before each test
setupFilesAfterEnv: [
'./src/setupTests.ts'
],
setupFilesAfterEnv: ['./src/setupTests.ts'],

// A list of paths to snapshot serializer modules Jest should use for snapshot testing
// snapshotSerializers: [],
Expand All @@ -159,10 +157,7 @@ module.exports = {
// testLocationInResults: false,

// The glob patterns Jest uses to detect test files
testMatch: [
'**/__tests__/**/*.[jt]s?(x)',
'**/?(*.)+(spec|test).[tj]s?(x)'
],
testMatch: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[tj]s?(x)'],

// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
// testPathIgnorePatterns: [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
"webpack": "webpack --config webpack.config.js",
"dts": "tsc --declaration --outDir dist/types/ --emitDeclarationOnly --declarationMap --allowJs false --checkJs false",
"pre-push": "yarn run lint-ci && yarn run test && yarn run clean && yarn run webpack && yarn run dts",
"test": "jest",
"test": "jest --collectCoverage=false",
"test-ci": "rm -rf 'coverage/*' && jest --collectCoverage=true && jest-coverage-badges",
"update-tests": "jest -u",
"test-interactive": "jest --watch",
Expand Down

0 comments on commit 36c396b

Please sign in to comment.