deepkit-framework icon indicating copy to clipboard operation
deepkit-framework copied to clipboard

[typeCompiler] Array<{...}> does not work under jest / ts-jest

Open CristianPi opened this issue 3 years ago • 0 comments

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; }>

CristianPi avatar Sep 10 '22 22:09 CristianPi