Skip to content

Commit

Permalink
feat: remove factory helper methods and test associateds (#30)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Helper methods removed were a core part of previous versions
  • Loading branch information
jorgebodega committed Jan 6, 2022
1 parent ddb5c2f commit 3393724
Show file tree
Hide file tree
Showing 19 changed files with 2 additions and 381 deletions.
15 changes: 0 additions & 15 deletions sample/factories/pet.factory.ts

This file was deleted.

18 changes: 0 additions & 18 deletions sample/factories/user.factory.ts

This file was deleted.

9 changes: 0 additions & 9 deletions sample/seeds/create-pets.seed.ts

This file was deleted.

9 changes: 0 additions & 9 deletions sample/seeds/create-users.seed.ts

This file was deleted.

22 changes: 0 additions & 22 deletions src/factoriesMap.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export * from './connection'
export * from './facade'
export * from './factoriesMap'
export * from './runSeeder'
export * from './seeder'
export * from './types'
Expand Down
3 changes: 1 addition & 2 deletions src/runSeeder.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { fetchConnection } from './connection'
import { factory } from './factoriesMap'
import { Seeder } from './seeder'

export async function runSeeder(seeder: Seeder) {
const connection = await fetchConnection()
seeder.run(factory, connection)
seeder.run(connection)
}
3 changes: 1 addition & 2 deletions src/seeder.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Connection } from 'typeorm'
import { EntityFactory } from './types'

export abstract class Seeder {
abstract run(factory: EntityFactory, connection: Connection): Promise<void>
abstract run(connection: Connection): Promise<void>
}
12 changes: 0 additions & 12 deletions test/factories/Pet.factory.ts

This file was deleted.

5 changes: 0 additions & 5 deletions test/factories/User.factory.ts

This file was deleted.

10 changes: 0 additions & 10 deletions test/factories/UserFactoryFunction.ts

This file was deleted.

26 changes: 0 additions & 26 deletions test/factoriesMap.test.ts

This file was deleted.

158 changes: 0 additions & 158 deletions test/factory.test.ts

This file was deleted.

13 changes: 0 additions & 13 deletions test/runSeeder.test.ts

This file was deleted.

9 changes: 0 additions & 9 deletions test/seeders/1-User.seed.ts

This file was deleted.

15 changes: 0 additions & 15 deletions test/seeders/2-Pet.seed.ts

This file was deleted.

17 changes: 0 additions & 17 deletions test/useSeeders/useSeedersWithError.spec.ts

This file was deleted.

11 changes: 0 additions & 11 deletions test/useSeeders/useSeedersWithMultipleSeeders.test.ts

This file was deleted.

Loading

0 comments on commit 3393724

Please sign in to comment.