From 519e84381996b4a149906112689c2d5eafd6e25d Mon Sep 17 00:00:00 2001 From: Chris Wendt Date: Wed, 16 Aug 2017 14:30:00 -0700 Subject: [PATCH] Add ability to cause the test to fail --- src/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/index.js b/src/index.js index 3432c27..19878ed 100644 --- a/src/index.js +++ b/src/index.js @@ -52,6 +52,7 @@ module.exports = { }, postTest: function() { + let addFailure = this.addFailure; let config = this.config; if (!this.enabled) { @@ -66,6 +67,10 @@ module.exports = { return; } + if (config.failOnMessage) { + addFailure('Unexpected console messages were logged.'); + } + printHeader.call(config); _(result)