(args: FlushEventArgs)
| 60 | |
| 61 | class ProjectUsersSubscriber implements EventSubscriber<ProjectUser> { |
| 62 | async afterFlush(args: FlushEventArgs): Promise<void> { |
| 63 | const uow = args.uow; |
| 64 | const changeSets = uow.getChangeSets().filter(cs => cs.entity instanceof ProjectUser); |
| 65 | for (const cs of changeSets) { |
| 66 | const pk = cs.getPrimaryKey(true)! as Record<string, unknown>; |
| 67 | expect(pk).toBeInstanceOf(Object); |
| 68 | expect(Array.isArray(pk)).toBe(false); |
| 69 | expect(Object.keys(pk)).toMatchObject(['project', 'user']); |
| 70 | expect(Object.values(pk).map(v => typeof v)).toMatchObject(['number', 'number']); |
| 71 | } |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | let orm: MikroORM; |
nothing calls this directly
no test coverage detected