Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a number of assertions that weren't asserting anything #2082

Merged
merged 1 commit into from
Jan 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/acceptance/utils.js
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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