Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
test: 'clean' in 'ChainedMap' (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
ulivz authored and edmorley committed Aug 22, 2018
1 parent 3a4b3e1 commit 04eebb9
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/ChainedMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,26 @@ test('when false', t => {
t.false(map.has('alpha'));
t.true(map.has('beta'));
});

test('clean undefined', t => {
const map = new ChainedMap();
map.set('alpha', undefined);
map.set('beta', 'b');
t.true('alpha' in map.entries());
t.false('alpha' in map.clean(map.entries()));
t.true('beta' in map.clean(map.entries()));
});

test('clean empty array', t => {
const map = new ChainedMap();
map.set('alpha', []);
t.true('alpha' in map.entries());
t.false('alpha' in map.clean(map.entries()));
});

test('clean empty object', t => {
const map = new ChainedMap();
map.set('alpha', {});
t.true('alpha' in map.entries());
t.false('alpha' in map.clean(map.entries()));
});

0 comments on commit 04eebb9

Please sign in to comment.