new expect empty tests

This commit is contained in:
Jake Luer 2011-12-24 13:10:55 -05:00
parent a4ca608f45
commit bb6c5e97e8

View file

@ -200,6 +200,14 @@ var expectTests = module.exports = {
expect({}).to.be.empty;
}, 'expected {} to have a property \'length\'');
err(function(){
expect([ 'hello', 'world' ]).to.be.empty;
}, "expected [ \'hello\', \'world\' ] to be empty");
err(function(){
expect([ { hello: 'world' } ]).to.be.empty;
}, "expected [ { hello: \'world\' } ] to be empty");
err(function(){
expect('asd').to.be.empty;
}, "expected 'asd' to be empty");
@ -406,6 +414,22 @@ var expectTests = module.exports = {
err(function(){
expect(refErrFn).to.throw(Error);
}, "expected [Function] to throw Error but a ReferenceError was thrown");
},
/*
'test async': function (done) {
setTimeout(function() {
expect('').to.not.be.empty;
expect([]).to.be.empty;
expect({ length: 0 }).to.be.empty;
err(function(){
expect({}).to.be.empty;
}, 'expected {} to have a property \'length\'');
done();
}, 1000);
}
*/
}
};