Total Complexity | 1 |
Total Lines | 10 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | import { Seeder } from '@concepta/typeorm-seeding'; |
||
3 | |||
4 | export class UserSeeder extends Seeder { |
||
5 | async run() { |
||
6 | // get a user factory |
||
7 | const userFactory = this.factory(UserFactory); |
||
8 | const johnFactory = this.factory(JohnFactory); |
||
9 | // using defaults |
||
10 | await johnFactory.create(); |
||
11 | // with email override |
||
12 | await userFactory.createMany(5); |
||
13 | // persist to database (optional) |
||
16 |