Skip to content

Commit

Permalink
test(keysRecorder):many tests case
Browse files Browse the repository at this point in the history
  • Loading branch information
yidinghan committed Apr 11, 2017
1 parent f5ae9b1 commit 66b447d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,28 @@ test('keysRecorder:should get defaults and selects', (t) => {
t.deepEqual(result, { a: 1, b: 2 });
});

test('keysRecorder:should only get c.d', (t) => {
const recorder = keysRecorder({
defaults: ['c.d'],
selects: ['b'],
unselects: ['b'],
});
const result = recorder(testTarget);

t.deepEqual(result, { c: { d: 3 } });
});

test('keysRecorder:should get defaults and selects and unselects', (t) => {
const recorder = keysRecorder({
defaults: ['a'],
selects: ['c'],
unselects: ['c.e'],
});
const result = recorder(testTarget);

t.deepEqual(result, { a: 1, c: { d: 3 } });
});

test('keysRecorder:should get defaults and unselects', (t) => {
const recorder = keysRecorder({
defaults: ['c'],
Expand Down

0 comments on commit 66b447d

Please sign in to comment.