-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathobject_is.js
32 lines (32 loc) · 1.18 KB
/
object_is.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
module.exports=require('../../theory')
({name: 'is_object'
, init: function(a){
describe('objects',function(){
it('is()',function(){
expect(theory.obj({}).is()).to.be(true);
expect(theory.obj({a:1}).is()).to.be(true);
expect(theory.obj(0).is()).to.be(false);
expect(theory.obj(1).is()).to.be(false);
expect(theory.obj('').is()).to.be(false);
expect(theory.obj('a').is()).to.be(false);
expect(theory.obj([]).is()).to.be(false);
expect(theory.obj([1]).is()).to.be(false);
expect(theory.obj(false).is()).to.be(false);
expect(theory.obj(true).is()).to.be(false);
expect(theory.obj(function(){}).is()).to.be(false);
});
it('is',function(){
expect(theory.obj.is({})).to.be(true);
expect(theory.obj.is({a:1})).to.be(true);
expect(theory.obj.is(0)).to.be(false);
expect(theory.obj.is(1)).to.be(false);
expect(theory.obj.is('')).to.be(false);
expect(theory.obj.is('a')).to.be(false);
expect(theory.obj.is([])).to.be(false);
expect(theory.obj.is([1])).to.be(false);
expect(theory.obj.is(false)).to.be(false);
expect(theory.obj.is(true)).to.be(false);
expect(theory.obj.is(function(){})).to.be(false);
});
});
}});