Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
nickschot committed Oct 14, 2021
1 parent 1c6d390 commit 8c5147f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/@ember/-internals/metal/tests/is_empty_test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { isEmpty } from '..';
import { moduleFor, AbstractTestCase } from 'internal-test-helpers';
import ObjectProxy from '../../runtime/lib/system/object_proxy';

moduleFor(
'isEmpty',
Expand All @@ -8,6 +9,7 @@ moduleFor(
let string = 'string';
let fn = function () {};
let object = { length: 0 };
let proxy = ObjectProxy.create({ content: { size: 0 } });

assert.equal(true, isEmpty(null), 'for null');
assert.equal(true, isEmpty(undefined), 'for undefined');
Expand All @@ -22,6 +24,7 @@ moduleFor(
assert.equal(true, isEmpty([]), 'for an empty Array');
assert.equal(false, isEmpty({}), 'for an empty Object');
assert.equal(true, isEmpty(object), "for an Object that has zero 'length'");
assert.equal(true, isEmpty(proxy), "for a proxy that has zero 'size'");
}
}
);

0 comments on commit 8c5147f

Please sign in to comment.