Skip to content

Instantly share code, notes, and snippets.

@sergiofilhowz
Created January 6, 2023 13:38
Show Gist options
  • Save sergiofilhowz/b1b8b465e94c2085188c697bcd6a9690 to your computer and use it in GitHub Desktop.
Save sergiofilhowz/b1b8b465e94c2085188c697bcd6a9690 to your computer and use it in GitHub Desktop.
Fixtures sample
import { faker } from '@faker-js/faker'
import { Quiz, QuizAnswer, QuizQuestion, QuizSubmissionInput } from '../graphql'
/* istanbul ignore next: no need to cover default value */
export const buildQuizAnswer = (answer: Partial<QuizAnswer> = {}): QuizAnswer => ({
id: faker.datatype.uuid(),
createdAt: faker.datatype.datetime(),
updatedAt: faker.datatype.datetime(),
content: faker.lorem.sentence(10),
isCorrect: faker.datatype.boolean(),
...answer,
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment