Skip to content

fixed all faker deprecated methods #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/db/utils.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import faker from 'faker'

export const generateUUID = () => faker.random.uuid()
export const generateUUID = () => faker.datatype.uuid()
8 changes: 4 additions & 4 deletions test/utils/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {getUserToken, getSaltAndHash} from '../../src/utils/auth'
// prefex all of the ones we generate with `!0_Oo` to ensure it's valid.
const getPassword = (...args) => `!0_Oo${faker.internet.password(...args)}`
const getUsername = faker.internet.userName
const getId = faker.random.uuid
const getId = faker.datatype.uuid
const getSynopsis = faker.lorem.paragraph
const getNotes = faker.lorem.paragraph

Expand All @@ -24,7 +24,7 @@ function buildBook(overrides) {
title: faker.lorem.words(),
author: faker.name.findName(),
coverImageUrl: faker.image.imageUrl(),
pageCount: faker.random.number(400),
pageCount: faker.datatype.number(400),
publisher: faker.company.companyName(),
synopsis: faker.lorem.paragraph(),
...overrides,
Expand All @@ -42,8 +42,8 @@ function buildListItem(overrides = {}) {
id: getId(),
bookId,
ownerId: owner.id,
rating: faker.random.number(5),
notes: faker.random.boolean() ? '' : getNotes(),
rating: faker.datatype.number(5),
notes: faker.datatype.boolean() ? '' : getNotes(),
finishDate,
startDate,
...overrides,
Expand Down