Skip to content

Commit 88cc66d

Browse files
committed
chore(faker): fix deprecated methods
1 parent 5b3b0ab commit 88cc66d

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

packages/-ember-caluma/mirage/factories/user.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ import { faker } from "@faker-js/faker";
22
import { Factory } from "miragejs";
33

44
export default Factory.extend({
5-
firstName: () => faker.name.firstName(),
6-
lastName: () => faker.name.lastName(),
5+
firstName: () => faker.person.firstName(),
6+
lastName: () => faker.person.lastName(),
77
});

packages/testing/addon-mirage-support/factories/answer.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default Factory.extend({
2121

2222
if (answer.value === undefined) {
2323
answer.update({
24-
value: faker.datatype.number({
24+
value: faker.number.int({
2525
min: answer.question.minValue,
2626
max: answer.question.maxValue,
2727
}),
@@ -32,7 +32,7 @@ export default Factory.extend({
3232

3333
if (answer.value === undefined) {
3434
answer.update({
35-
value: faker.datatype.number({
35+
value: faker.number.int({
3636
min: answer.question.minValue,
3737
max: answer.question.maxValue,
3838
precision: 0.1,

packages/testing/addon-mirage-support/factories/question.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,24 @@ export default Factory.extend({
1919
if (["TEXT", "TEXTAREA"].includes(question.type)) {
2020
if (question.maxLength === undefined) {
2121
question.update({
22-
maxLength: faker.datatype.number({ min: 1, max: 255 }),
22+
maxLength: faker.number.int({ min: 1, max: 255 }),
2323
});
2424
}
2525
if (question.minLength === undefined) {
2626
question.update({
27-
minLength: faker.datatype.number({ min: 1, max: 10 }),
27+
minLength: faker.number.int({ min: 1, max: 10 }),
2828
});
2929
}
3030
} else if (["INTEGER", "FLOAT"].includes(question.type)) {
3131
if (question.minValue === undefined) {
3232
question.update({
33-
minValue: faker.datatype.number({ min: 1, max: 100 }),
33+
minValue: faker.number.int({ min: 1, max: 100 }),
3434
});
3535
}
3636

3737
if (question.maxValue === undefined) {
3838
question.update({
39-
maxValue: faker.datatype.number({
39+
maxValue: faker.number.int({
4040
min: question.minValue + 1,
4141
max: 1000,
4242
}),

0 commit comments

Comments
 (0)