Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(reporter): don't double-count tests #86

Merged
merged 1 commit into from
Apr 1, 2021

Conversation

lkipke
Copy link
Contributor

@lkipke lkipke commented Apr 1, 2021

Summary

Whoops, our Jest reporter was double-counting all non-failure tests.

@lkipke lkipke added the bug Something isn't working label Apr 1, 2021
@lkipke lkipke requested review from sjbarag and alimnios72 April 1, 2021 21:40
@lkipke lkipke self-assigned this Apr 1, 2021
@@ -223,7 +223,6 @@ export class JestReporter {
* @param status The test result status
*/
protected addNonFailureTestResult(assert: Assert, status: Status) {
this.currentResults.numPassingTests++;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These numbers are incremented elsewhere:

parser.on("pass", (assert: Assert) => {
this.currentResults.numPassingTests++;
this.addNonFailureTestResult(assert, "passed");
});
parser.on("skip", (assert: Assert) => {
this.currentResults.numTodoTests++;
this.addNonFailureTestResult(assert, "skipped");
});
parser.on("todo", (assert: Assert) => {
this.currentResults.numTodoTests++;
this.addNonFailureTestResult(assert, "todo");
});

Copy link
Contributor

@sjbarag sjbarag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

schitts-creek-one-out-of-two-isnt-bad

Great catch!

@lkipke lkipke merged commit 9039954 into hulu:main Apr 1, 2021
@lkipke lkipke deleted the double-count-tests branch April 1, 2021 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants