Skip to content
Browse files

Add some tests for the happy path to bring up coverage numbers not co…

…mputed due to uncaught exception non-handling
  • Loading branch information...
1 parent e2f3eea commit e5d8c17e8f38a09e3ecc12a186eeebcb6edf4303 @gotwarlost gotwarlost committed
Showing with 8 additions and 1 deletion.
  1. +8 −1 test/cli/test-check-coverage-command.js
View
9 test/cli/test-check-coverage-command.js
@@ -59,12 +59,19 @@ module.exports = {
},
"should fail with multiple reasons when multiple thresholds violated": function (test) {
test.ok(existsSync(path.resolve(OUTPUT_DIR, 'coverage.json')));
- run([ '--statements=72','--functions=50','--branches=72','--lines=72', '-v' ], function (results) {
+ run([ '--statements=72','--functions=50','--branches=72','--lines=72' ], function (results) {
test.ok(!results.succeeded());
test.ok(results.grepError(/Coverage for lines/));
test.ok(results.grepError(/Coverage for statements/));
test.ok(results.grepError(/Coverage for branches/));
test.ok(!results.grepError(/Coverage for functions/));
+ test.done();
+ });
+ },
+ "should pass with multiple reasons when all thresholds in check": function (test) {
+ test.ok(existsSync(path.resolve(OUTPUT_DIR, 'coverage.json')));
+ run([ '--statements=60','--functions=50','--branches=50','--lines=60', '-v' ], function (results) {
+ test.ok(results.succeeded());
test.ok(!results.grepOutput(/\\"actuals\\"/), "Verbose message not printed as expected");
test.done();
});

0 comments on commit e5d8c17

Please sign in to comment.
Something went wrong with that request. Please try again.