Skip to content

Commit

Permalink
respect passWithNoTests from jest config
Browse files Browse the repository at this point in the history
It's undocumented, see jestjs/jest#8896
  • Loading branch information
ChALkeR committed Jul 19, 2024
1 parent 18f76fb commit 6b5ac6b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ if (options.jest) {
patterns.push(...(Array.isArray(config.testMatch) ? config.testMatch : [config.testMatch]))
}

if (config.passWithNoTests) options.passWithNoTests = true
const testRegex = config.testRegex ? new RegExp(config.testRegex, 'u') : null
const ignoreRegexes = config.testPathIgnorePatterns.map((x) => new RegExp(x, 'u'))
if (testRegex || ignoreRegexes.length > 0) {
Expand Down
1 change: 1 addition & 0 deletions src/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const normalizeJestConfig = (config) => ({
testEnvironment: 'node',
testTimeout: 5000,
testPathIgnorePatterns: [],
passWithNoTests: false,
snapshotSerializers: [],
injectGlobals: true,
maxConcurrency: 5,
Expand Down

0 comments on commit 6b5ac6b

Please sign in to comment.