dify/web/test/factories/index.ts

31 lines
616 B
TypeScript
Raw Normal View History

2023-05-15 08:51:32 +08:00
import { Factory } from 'miragejs'
import { faker } from '@faker-js/faker'
import type { User } from '@/models/user'
export const seedUser = () => {
return Factory.extend<Partial<User>>({
firstName() {
return faker.name.firstName()
},
lastName() {
return faker.name.lastName()
},
name() {
return faker.address.streetAddress()
},
phone() {
return faker.phone.number()
},
email() {
return faker.internet.email()
},
username() {
return faker.internet.userName()
},
avatar() {
return faker.internet.avatar()
},
})
2023-05-15 08:51:32 +08:00
}