Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

Add test for Mocha.bail()

38elements3ff53a4d533f
diff --git a/test/unit/mocha.spec.js b/test/unit/mocha.spec.js
index 37b75ffd..93ab7f61 100644
--- a/test/unit/mocha.spec.js
+++ b/test/unit/mocha.spec.js
@@ -167,4 +167,13 @@ describe('Mocha', function () {
expect(mocha.options.delay).to.equal(true);
});
});
+
+ describe('.bail()', function () {
+ it('should set the suite._bail to true if there is no arguments', function () {
+ var mocha = new Mocha({bail: false});
+ expect(mocha.suite._bail).to.equal(false);
+ mocha.bail();
+ expect(mocha.suite._bail).to.equal(true);
+ });
+ });
});