diff --git a/test/unit/mocha.spec.js b/test/unit/mocha.spec.js index beb5e2b5e0..73c74f6b8b 100644 --- a/test/unit/mocha.spec.js +++ b/test/unit/mocha.spec.js @@ -21,6 +21,7 @@ describe('Mocha', function() { sandbox.stub(Mocha.prototype, 'useColors').returnsThis(); sandbox.stub(utils, 'deprecate'); }); + it('should prefer "color" over "useColors"', function() { // eslint-disable-next-line no-new new Mocha({useColors: true, color: false}); @@ -70,14 +71,6 @@ describe('Mocha', function() { }); }); - describe('.addFile()', function() { - it('should add the given file to the files array', function() { - var mocha = new Mocha(opts); - mocha.addFile('myFile.js'); - expect(mocha.files, 'to have length', 1).and('to contain', 'myFile.js'); - }); - }); - describe('.invert()', function() { it('should set the invert option to true', function() { var mocha = new Mocha(opts); @@ -153,6 +146,7 @@ describe('Mocha', function() { expect(mocha.options, 'to have property', 'growl', true); }); }); + describe('if not capable of notifications', function() { it('should set the growl option to false', function() { var mocha = new Mocha(opts); @@ -163,6 +157,7 @@ describe('Mocha', function() { expect(mocha.options, 'to have property', 'growl', false); }); }); + it('should be chainable', function() { var mocha = new Mocha(opts); expect(mocha.growl(), 'to be', mocha); @@ -195,11 +190,17 @@ describe('Mocha', function() { }); describe('.noHighlighting()', function() { + // :NOTE: Browser-only option... it('should set the noHighlighting option to true', function() { var mocha = new Mocha(opts); mocha.noHighlighting(); expect(mocha.options, 'to have property', 'noHighlighting', true); }); + + it('should be chainable', function() { + var mocha = new Mocha(opts); + expect(mocha.noHighlighting(), 'to be', mocha); + }); }); describe('.allowUncaught()', function() { @@ -208,6 +209,11 @@ describe('Mocha', function() { mocha.allowUncaught(); expect(mocha.options, 'to have property', 'allowUncaught', true); }); + + it('should be chainable', function() { + var mocha = new Mocha(opts); + expect(mocha.allowUncaught(), 'to be', mocha); + }); }); describe('.delay()', function() { @@ -216,6 +222,11 @@ describe('Mocha', function() { mocha.delay(); expect(mocha.options, 'to have property', 'delay', true); }); + + it('should be chainable', function() { + var mocha = new Mocha(opts); + expect(mocha.delay(), 'to be', mocha); + }); }); describe('.bail()', function() { @@ -224,6 +235,11 @@ describe('Mocha', function() { mocha.bail(); expect(mocha.suite._bail, 'to be', true); }); + + it('should be chainable', function() { + var mocha = new Mocha(opts); + expect(mocha.bail(), 'to be', mocha); + }); }); describe('error handling', function() {