Skip to content

Commit

Permalink
test: add unit test case
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoluoHe committed Aug 20, 2024
1 parent cc8452b commit 38b4d2f
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions packages/vutils/__tests__/common/merge.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,29 @@ describe('merge', () => {
}
});

expect(result).toEqual(expected);
});
it('null value in target should not throw error', function () {
const target: any = {
style: {
stroke: null
}
};

const source = {
style: {
stroke: { type: 'palette', key: 'color1' }
}
};

const expected = {
style: {
stroke: { type: 'palette', key: 'color1' }
}
};

const result = merge(target, source);

expect(result).toEqual(expected);
});
});

0 comments on commit 38b4d2f

Please sign in to comment.