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

server/src/TestFactories/Seeders/UserSeeder.ts   A

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 16
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 12
mnd 0
bc 0
fnc 1
dl 0
loc 16
rs 10
bpm 0
cpm 1
noi 0
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A UserSeeder.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