Skip to content

Commit

Permalink
test: merge with generic
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed Jul 31, 2024
1 parent 31baaa6 commit 5170ab6
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/merge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,19 @@ describe("mixme.merge", () => {
const obj = Object.create({});
should(obj.polluted).be.Undefined();
});
it("generic interface matching", () => {
interface Test {
a?: string;
b?: string;
}
interface Result {
a: string;
b: string;
}
const test: Test = {
b: "A",
};
const res: Result = merge<Test[]>({ b: "B" }, test);
console.log(res);
});
});

0 comments on commit 5170ab6

Please sign in to comment.