deepkit-framework
deepkit-framework copied to clipboard
[typeCompiler] Array<{...}> does not work under jest / ts-jest
enum UserRole {
ADMIN,
STAFF
}
export class UserA {
name: string
surname: string
avatar: string
status: string
email: string
password: string
settings: any
workers: Array<{ role: UserRole; email: string; }>; // kind 0 never, do not work
worker1: { role: UserRole; email: string; }; // works
workers2: { role: UserRole; email: string; }[]; // works
static from(user: UserA) {
return Object.assign(new UserA(), user);
}
}
this works
{ role: UserRole; email: string; }[]
this not
Array<{ role: UserRole; email: string; }>