Skip to content

Commit

Permalink
test: Test DeepPartial with any and {[k: string]: any}
Browse files Browse the repository at this point in the history
This tests typeorm#6580.
  • Loading branch information
MatthiasKunnen committed Aug 18, 2020
1 parent c96ab43 commit 7fdea70
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/github-issues/6580/entity/Comment.ts
@@ -0,0 +1,4 @@
export class Comment {
any: any;
object: {[k: string]: any};
}
24 changes: 24 additions & 0 deletions test/github-issues/6580/issue-6580.ts
@@ -0,0 +1,24 @@
import {DeepPartial} from "../../../src";
import {Comment} from "./entity/Comment";

describe("github issues > #6580 DeepPartial does not handle `any` and `{[k: string]}`", () => {

function attemptDeepPartial(entityLike: DeepPartial<Comment>): void {
}

it("DeepPartial should correctly handle any", () => {
attemptDeepPartial({
any: {
foo: 'bar',
}
})
});

it("DeepPartial should correctly handle {[k: string]: any}", () => {
attemptDeepPartial({
object: {
foo: 'bar'
},
})
});
});

0 comments on commit 7fdea70

Please sign in to comment.