chore(test): clean up factories

This commit is contained in:
Phan An 2022-05-15 17:04:59 +02:00
parent 6a2e977138
commit cc907926ef
No known key found for this signature in database
GPG key ID: A81E4477F0BB6FDC
7 changed files with 12 additions and 13 deletions

View file

@ -1,18 +1,17 @@
import { Faker } from '@faker-js/faker'
import factory from 'factoria' import factory from 'factoria'
import artist from './artist' import artistFactory from './artistFactory'
import album from './album' import albumFactory from './albumFactory'
import song from './song' import songFactory from './songFactory'
import video from './video' import playlistFactory from './playlistFactory'
import playlist from './playlist' import userFactory, { states as userStates } from './userFactory'
import user, { states as userStates } from './user' import youTubeVideoFactory from './youTubeVideoFactory'
factory factory
.define('artist', (faker: Faker): Artist => artist(faker)) .define('artist', faker => artistFactory(faker))
.define('album', (faker: Faker): Album => album(faker)) .define('album', faker => albumFactory(faker))
.define('song', (faker: Faker): Song => song(faker)) .define('song', faker => songFactory(faker))
.define('video', (faker: Faker): YouTubeVideo => video(faker)) .define('video', faker => youTubeVideoFactory(faker))
.define('playlist', (faker: Faker): Playlist => playlist(faker)) .define('playlist', faker => playlistFactory(faker))
.define('user', (faker: Faker): User => user(faker), userStates) .define('user', faker => userFactory(faker), userStates)
export default factory export default factory