Created
December 28, 2021 20:47
-
-
Save HonzaMac/ea0bc0ba1e0f7926b6a44eea992b64ef to your computer and use it in GitHub Desktop.
createUser with fake data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as faker from "faker" | |
import { User } from "../../src/userService" | |
export const createUser = (data: Partial<User> = {}) => { | |
const fakeData: User = { | |
username: faker.name.findName(), | |
email: faker.internet.email(), | |
country: faker.address.country(), | |
department: faker.company.companyName(), | |
divisionName: faker.name.jobArea(), | |
} | |
return { | |
id: 'e2f5a82a-3f2e-4b6d-b4d2-086afaa08f8a', | |
...fakeData, | |
...data, | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment