Skip to content

Commit

Permalink
fix instances of findRelatedTests
Browse files Browse the repository at this point in the history
findRelatedTests used to be a boolean field. It has been updated to be Array<string>. We will check the length of the array to determine if findRelatedTests is falsy or truthy since 0 will evaluate to false and aything greater than 0 will evaluate to true.
  • Loading branch information
mackness committed Apr 24, 2019
1 parent 9d7aed1 commit 813fab3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/jest-core/src/runJest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export default (async function runJest({

if (
globalConfig.passWithNoTests ||
globalConfig.findRelatedTests ||
globalConfig.findRelatedTests.length ||

This comment has been minimized.

Copy link
@SimenB

SimenB Apr 24, 2019

Member

can we be explicit (> 0)?

globalConfig.lastCommit ||
globalConfig.onlyChanged
) {
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-reporters/src/summary_reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export default class SummaryReporter extends BaseReporter {
globalConfig: Config.GlobalConfig,
) {
const getMatchingTestsInfo = () => {
const prefix = globalConfig.findRelatedTests
const prefix = globalConfig.findRelatedTests.length
? ' related to files matching '
: ' matching ';

Expand Down

0 comments on commit 813fab3

Please sign in to comment.