Skip to content

Commit

Permalink
feat(faker): update deprecated faker methods (#978)
Browse files Browse the repository at this point in the history
  • Loading branch information
MtBlue81 authored Oct 28, 2023
1 parent c1949f4 commit e74377e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/msw/src/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,18 @@ const getMockScalarJsTypes = (
switch (type) {
case 'number':
return isArray
? `Array.from({length: faker.datatype.number({` +
? `Array.from({length: faker.number.int({` +
`min: ${mockOptionsWithoutFunc.arrayMin}, ` +
`max: ${mockOptionsWithoutFunc.arrayMax}}` +
`)}, () => faker.datatype.number())`
: 'faker.datatype.number().toString()';
`)}, () => faker.number.int())`
: 'faker.number.int().toString()';
case 'string':
return isArray
? `Array.from({length: faker.datatype.number({` +
? `Array.from({length: faker.number.int({` +
`min: ${mockOptionsWithoutFunc?.arrayMin},` +
`max: ${mockOptionsWithoutFunc?.arrayMax}}` +
`)}, () => faker.random.word())`
: 'faker.random.word()';
`)}, () => faker.word.sample())`
: 'faker.word.sample()';
default:
return 'undefined';
}
Expand Down

0 comments on commit e74377e

Please sign in to comment.