1 | describe('is-empty', function () {
|
2 |
|
3 | var empty = require('..');
|
4 |
|
5 | it('handles arrays', function () {
|
6 | empty([]).should.be.true;
|
7 | empty(['a', 'b']).should.be.false;
|
8 | });
|
9 |
|
10 | it('handles objects', function () {
|
11 | empty({}).should.be.true;
|
12 | empty({ a: 'b' }).should.be.false;
|
13 | });
|
14 |
|
15 | it('handles strings', function () {
|
16 | empty('').should.be.true;
|
17 | empty('string').should.be.false;
|
18 | });
|
19 |
|
20 | it('handles numbers', function () {
|
21 | empty(0).should.be.true;
|
22 | empty(42).should.be.false;
|
23 | });
|
24 |
|
25 | it('handles functions', function () {
|
26 | empty(function(){}).should.be.true;
|
27 | empty(function(a,b){}).should.be.false;
|
28 | });
|
29 |
|
30 | it('handles nulls', function () {
|
31 | empty(null).should.be.true;
|
32 | empty(undefined).should.be.true;
|
33 | });
|
34 |
|
35 | }); |
\ | No newline at end of file |