Skip to content

Commit

Permalink
Fix a number of assertions that weren't asserting anything
Browse files Browse the repository at this point in the history
They were missing parentheses and thus no assertion method was ever executed.
  • Loading branch information
mislav committed Jan 28, 2016
1 parent cf513cb commit 29a679b
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions test/acceptance/utils.js
Expand Up @@ -385,9 +385,9 @@ describe('lib/utils', function () {
.should.containEql('/tmp/mocha-utils-link.js')
.and.containEql('/tmp/mocha-utils.js')
.and.have.lengthOf(2);
existsSync('/tmp/mocha-utils-link.js').should.be.true;
existsSync('/tmp/mocha-utils-link.js').should.be.true();
fs.renameSync('/tmp/mocha-utils.js', '/tmp/bob');
existsSync('/tmp/mocha-utils-link.js').should.be.false;
existsSync('/tmp/mocha-utils-link.js').should.be.false();
utils.lookupFiles('/tmp', ['js'], false).should.eql([]);
});

Expand Down
2 changes: 1 addition & 1 deletion test/grep.js
Expand Up @@ -42,7 +42,7 @@ describe('Mocha', function(){
describe('"invert" option', function(){
it('should add a Boolean to the mocha.options object', function(){
var mocha = new Mocha({ invert: true });
mocha.options.invert.should.be.ok;
mocha.options.invert.should.be.ok();
})
})
})
10 changes: 5 additions & 5 deletions test/runnable.js
Expand Up @@ -67,23 +67,23 @@ describe('Runnable(title, fn)', function(){
it('should be .async', function(){
var run = new Runnable('foo', function(done){});
run.async.should.equal(1);
run.sync.should.be.false;
run.sync.should.be.false();
})
})

describe('when arity == 0', function(){
it('should be .sync', function(){
var run = new Runnable('foo', function(){});
run.async.should.be.equal(0);
run.sync.should.be.true;
run.sync.should.be.true();
})
})

describe('#globals', function(){
it('should allow for whitelisting globals', function(done){
var test = new Runnable('foo', function(){});
test.async.should.be.equal(0);
test.sync.should.be.true;
test.sync.should.be.true();
test.globals(['foobar']);
test.run(done);
})
Expand Down Expand Up @@ -327,7 +327,7 @@ describe('Runnable(title, fn)', function(){
});
test.timeout(10);
test.run(function(err){
err.should.be.ok;
err.should.be.ok();
callCount.should.equal(1);
done();
});
Expand Down Expand Up @@ -427,7 +427,7 @@ describe('Runnable(title, fn)', function(){

test.timeout(10);
test.run(function(err){
err.should.be.ok;
err.should.be.ok();
done();
});
})
Expand Down
4 changes: 2 additions & 2 deletions test/runner.js
Expand Up @@ -114,7 +114,7 @@ describe('Runner', function(){
it ('should not fail when a new common global is introduced', function(){
// verify that the prop isn't enumerable
delete global.XMLHttpRequest;
global.propertyIsEnumerable('XMLHttpRequest').should.not.be.ok;
global.propertyIsEnumerable('XMLHttpRequest').should.not.be.ok();

// create a new runner and keep a reference to the test.
var test = new Test('im a test about bears');
Expand All @@ -123,7 +123,7 @@ describe('Runner', function(){

// make the prop enumerable again.
global.XMLHttpRequest = function() {};
global.propertyIsEnumerable('XMLHttpRequest').should.be.ok;
global.propertyIsEnumerable('XMLHttpRequest').should.be.ok();

// verify the test hasn't failed.
newRunner.checkGlobals(test);
Expand Down
18 changes: 9 additions & 9 deletions test/suite.js
Expand Up @@ -31,31 +31,31 @@ describe('Suite', function(){
});

it('should copy the bail value', function(){
this.suite.clone().bail().should.be.true;
this.suite.clone().bail().should.be.true();
});

it('should not copy the values from the suites array', function(){
this.suite.clone().suites.should.be.empty;
this.suite.clone().suites.should.be.empty();
});

it('should not copy the values from the tests array', function(){
this.suite.clone().tests.should.be.empty;
this.suite.clone().tests.should.be.empty();
});

it('should not copy the values from the _beforeEach array', function(){
this.suite.clone()._beforeEach.should.be.empty;
this.suite.clone()._beforeEach.should.be.empty();
});

it('should not copy the values from the _beforeAll array', function(){
this.suite.clone()._beforeAll.should.be.empty;
this.suite.clone()._beforeAll.should.be.empty();
});

it('should not copy the values from the _afterEach array', function(){
this.suite.clone()._afterEach.should.be.empty;
this.suite.clone()._afterEach.should.be.empty();
});

it('should not copy the values from the _afterAll array', function(){
this.suite.clone()._afterAll.should.be.empty;
this.suite.clone()._afterAll.should.be.empty();
});
});

Expand Down Expand Up @@ -112,14 +112,14 @@ describe('Suite', function(){

describe('when no argument is passed', function(){
it('should return the bail value', function(){
this.suite.bail().should.be.true;
this.suite.bail().should.be.true();
});
});

describe('when argument is passed', function(){
it('should return the Suite object', function(){
var newSuite = this.suite.bail(false);
newSuite.bail().should.be.false;
newSuite.bail().should.be.false();
});
});
});
Expand Down
4 changes: 2 additions & 2 deletions test/test.js
Expand Up @@ -29,7 +29,7 @@ describe('Test', function(){
});

it('should copy the enableTimeouts value', function(){
this._test.clone().enableTimeouts().should.be.true;
this._test.clone().enableTimeouts().should.be.true();
});

it('should copy the retries value', function(){
Expand All @@ -41,7 +41,7 @@ describe('Test', function(){
});

it('should copy the globals value', function(){
this._test.clone().globals().should.not.be.empty;
this._test.clone().globals().should.not.be.empty();
});

it('should copy the parent value', function(){
Expand Down

0 comments on commit 29a679b

Please sign in to comment.