-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed as not planned
Closed as not planned
Copy link
Labels
bugcurrent functionality does not work as desiredcurrent functionality does not work as desiredhelp wantedscope:watch-mode
Description
I noticed that changing the source file sometimes leads to ava reporting a "1 previous failure in test files that were not rerun" even though the tests testing that file already passed. This message is a bit confusing since the test actually was rerun and passed.
I saw that the relevant line that "prunes" the failures is
Line 267 in 9cedc97
this.pruneFailures(plan.files); |
But that line seems to run after the failures have already been passed to the api at
Line 125 in 9cedc97
previousFailures: this.sumPreviousFailures(this.runVector), |
It's either possible to modify the array instead at
Line 293 in 9cedc97
this.filesWithFailures = this.filesWithFailures.filter(state => !toPrune.has(state.file)); |
watcher.js
runtimeOptions: {
clearLogOnNextRun,
previousFailures: () => this.sumPreviousFailures(this.runVector), // This is now a function
runOnlyExclusive,
runVector: this.runVector,
updateSnapshots: updateSnapshots === true
}
and reporters/default.js
if (this.previousFailures() > 0) { // Which we call in the reporter to get the up to date data
this.lineWriter.writeLine(colors.error(`${this.previousFailures()} previous ${plur('failure', this.previousFailures())} in test files that were not rerun`));
}
The code is taken from the latest commit on
ava@next
yurivish
Metadata
Metadata
Assignees
Labels
bugcurrent functionality does not work as desiredcurrent functionality does not work as desiredhelp wantedscope:watch-mode