Skip to content

Commit

Permalink
Merge pull request #1 from chlafreniere/fix/potentialzerotest
Browse files Browse the repository at this point in the history
Potential fix for zero test issue
  • Loading branch information
chlafreniere authored Jan 31, 2020
2 parents 6c69c0f + c4a6ea1 commit 920eb35
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 18 deletions.
9 changes: 2 additions & 7 deletions out/src/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion out/src/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 5 additions & 10 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,16 +198,11 @@ function run(testsRoot, clb): any {
return mocha.addFile(paths.join(testsRoot, f));
});
// Run the tests
let failureCount = 0;

// Pass an empty handler to prevent NPE https://github.com/stanleyhlng/mocha-multi-reporters/issues/48
mocha.run(() => { })
.on('fail', function (test, err): void {
failureCount++;
})
.on('end', function (): void {
clb(undefined, failureCount);
});

mocha.run((failure) => {
clb(undefined, failure);
});

} catch (error) {
return clb(error);
}
Expand Down

0 comments on commit 920eb35

Please sign in to comment.