Skip to content

Commit

Permalink
test: 补充merge测试用例
Browse files Browse the repository at this point in the history
  • Loading branch information
novlan1 committed Aug 16, 2023
1 parent ca20a44 commit 2bec82a
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions test/lodash-mini/merge.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,39 @@ describe('merge', () => {
o: { a: 3, b: 4 },
});
});

it('merge falsy', () => {
expect(merge({
isUseVueLoader: true,
isVue3: false,
useXSS: true,

a: 1,
}, {
useXSS: false,
a: null,
})).toEqual({
isUseVueLoader: true,
isVue3: false,
useXSS: false,
a: null,
});


const {
isUseVueLoader,
isVue3,
useXSS,
} = merge({}, {
isUseVueLoader: true,
isVue3: false,
useXSS: true,
}, {
isVue3: true,
useXSS: false,
});
expect(isUseVueLoader).toBe(true);
expect(isVue3).toBe(true);
expect(useXSS).toBe(false);
});
});

0 comments on commit 2bec82a

Please sign in to comment.