Skip to content

Commit

Permalink
convert test/unit/mocha.spec.js to unexpected
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
  • Loading branch information
boneskull committed Apr 21, 2018
1 parent 7aa9b82 commit c43c096
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions test/unit/mocha.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('Mocha', function () {
});
mocha.suite.addTest(failingTest);
mocha.run(function (failures) {
expect(failures).to.equal(1);
expect(failures, 'to be', 1);
done();
});
});
Expand All @@ -37,143 +37,143 @@ describe('Mocha', function () {
it('should add the given file to the files array', function () {
var mocha = new Mocha(blankOpts);
mocha.addFile('myFile.js');
expect(mocha.files.length).to.equal(1);
expect(mocha.files[0]).to.equal('myFile.js');
expect(mocha.files.length, 'to be', 1);
expect(mocha.files[0], 'to be', 'myFile.js');
});
});

describe('.invert()', function () {
it('should set the invert option to true', function () {
var mocha = new Mocha(blankOpts);
mocha.invert();
expect(mocha.options.invert).to.equal(true);
expect(mocha.options.invert, 'to be', true);
});

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

describe('.ignoreLeaks()', function () {
it('should set the ignoreLeaks option to true when param equals true', function () {
var mocha = new Mocha(blankOpts);
mocha.ignoreLeaks(true);
expect(mocha.options.ignoreLeaks).to.equal(true);
expect(mocha.options.ignoreLeaks, 'to be', true);
});

it('should set the ignoreLeaks option to false when param equals false', function () {
var mocha = new Mocha(blankOpts);
mocha.ignoreLeaks(false);
expect(mocha.options.ignoreLeaks).to.equal(false);
expect(mocha.options.ignoreLeaks, 'to be', false);
});

it('should set the ignoreLeaks option to false when the param is undefined', function () {
var mocha = new Mocha(blankOpts);
mocha.ignoreLeaks();
expect(mocha.options.ignoreLeaks).to.equal(false);
expect(mocha.options.ignoreLeaks, 'to be', false);
});

it('should be chainable', function () {
var mocha = new Mocha(blankOpts);
expect(mocha.ignoreLeaks(false)).to.equal(mocha);
expect(mocha.ignoreLeaks(false), 'to be', mocha);
});
});

describe('.checkLeaks()', function () {
it('should set the ignoreLeaks option to false', function () {
var mocha = new Mocha(blankOpts);
mocha.checkLeaks();
expect(mocha.options.ignoreLeaks).to.equal(false);
expect(mocha.options.ignoreLeaks, 'to be', false);
});

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

describe('.fullTrace()', function () {
it('should set the fullStackTrace option to true', function () {
var mocha = new Mocha(blankOpts);
mocha.fullTrace();
expect(mocha.options.fullStackTrace).to.equal(true);
expect(mocha.options.fullStackTrace, 'to be', true);
});

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

describe('.growl()', function () {
it('should set the growl option to true', function () {
var mocha = new Mocha(blankOpts);
mocha.growl();
expect(mocha.options.growl).to.equal(true);
expect(mocha.options.growl, 'to be', true);
});

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

describe('.useInlineDiffs()', function () {
it('should set the useInlineDiffs option to true when param equals true', function () {
var mocha = new Mocha(blankOpts);
mocha.useInlineDiffs(true);
expect(mocha.options.useInlineDiffs).to.equal(true);
expect(mocha.options.useInlineDiffs, 'to be', true);
});

it('should set the useInlineDiffs option to false when param equals false', function () {
var mocha = new Mocha(blankOpts);
mocha.useInlineDiffs(false);
expect(mocha.options.useInlineDiffs).to.equal(false);
expect(mocha.options.useInlineDiffs, 'to be', false);
});

it('should set the useInlineDiffs option to false when the param is undefined', function () {
var mocha = new Mocha(blankOpts);
mocha.useInlineDiffs();
expect(mocha.options.useInlineDiffs).to.equal(false);
expect(mocha.options.useInlineDiffs, 'to be', false);
});

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

describe('.noHighlighting()', function () {
it('should set the noHighlighting option to true', function () {
var mocha = new Mocha(blankOpts);
mocha.noHighlighting();
expect(mocha.options.noHighlighting).to.equal(true);
expect(mocha.options.noHighlighting, 'to be', true);
});
});

describe('.allowUncaught()', function () {
it('should set the allowUncaught option to true', function () {
var mocha = new Mocha(blankOpts);
mocha.allowUncaught();
expect(mocha.options.allowUncaught).to.equal(true);
expect(mocha.options.allowUncaught, 'to be', true);
});
});

describe('.delay()', function () {
it('should set the delay option to true', function () {
var mocha = new Mocha(blankOpts);
mocha.delay();
expect(mocha.options.delay).to.equal(true);
expect(mocha.options.delay, 'to be', 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);
expect(mocha.suite._bail, 'to be', false);
mocha.bail();
expect(mocha.suite._bail).to.equal(true);
expect(mocha.suite._bail, 'to be', true);
});
});
});

0 comments on commit c43c096

Please sign in to comment.