Passed
Pull Request — master (#350)
by
unknown
06:30 queued 04:29
created

UserSeeder   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 10
dl 0
loc 10
rs 10
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A run 0 8 1
1
import { Seeder } from '@concepta/typeorm-seeding';
2
import { UserFactory, JohnFactory } from '../Factories/UserFactory';
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)
14
  }
15
}
16