Skip to content

Commit

Permalink
additional unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
juergba committed Aug 29, 2019
1 parent 9189992 commit d97466d
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions test/unit/mocha.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,19 @@ describe('Mocha', function() {
});
});

describe('#enableTimeouts()', function() {
it('should set the suite._enableTimeouts to true if no argument', function() {
var mocha = new Mocha(opts);
mocha.enableTimeouts();
expect(mocha.suite._enableTimeouts, 'to be', true);
});

it('should be chainable', function() {
var mocha = new Mocha(opts);
expect(mocha.enableTimeouts(), 'to be', mocha);
});
});

describe('#fullTrace()', function() {
it('should set the fullStackTrace option to true', function() {
var mocha = new Mocha(opts);
Expand Down Expand Up @@ -303,6 +316,25 @@ describe('Mocha', function() {
});
});

describe('#useColors()', function() {
it('should set the color option to true', function() {
var mocha = new Mocha(opts);
mocha.useColors(true);
expect(mocha.options, 'to have property', 'color', true);
});

it('should not create the color property', function() {
var mocha = new Mocha(opts);
mocha.useColors();
expect(mocha.options, 'not to have property', 'color');
});

it('should be chainable', function() {
var mocha = new Mocha(opts);
expect(mocha.useColors(), 'to be', mocha);
});
});

describe('#useInlineDiffs()', function() {
it('should set the inlineDiffs option to true when param equals true', function() {
var mocha = new Mocha(opts);
Expand Down

0 comments on commit d97466d

Please sign in to comment.