Skip to content

Commit

Permalink
fix: Change to @faker/fakerjs to fix missing avatars
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwondercorn committed Jul 8, 2022
1 parent 78d0b82 commit 81ba515
Show file tree
Hide file tree
Showing 3 changed files with 378 additions and 105 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"@ember/jquery": "^1.1.0",
"@ember/optional-features": "^1.3.0",
"@embroider/test-setup": "^1.8.3",
"@faker-js/faker": "^7.3.0",
"@glimmer/component": "^1.0.1",
"@glimmer/tracking": "^1.0.0",
"babel-eslint": "^10.1.0",
Expand All @@ -56,7 +57,7 @@
"ember-cli-github-pages": "^0.2.2",
"ember-cli-inject-live-reload": "^2.0.2",
"ember-cli-less": "^3.0.1",
"ember-cli-mirage": "^1.1.0",
"ember-cli-mirage": "^1.1.8",
"ember-cli-release": "1.0.0-beta.2",
"ember-cli-sri": "^2.1.1",
"ember-cli-uglify": "^3.0.0",
Expand Down Expand Up @@ -84,7 +85,6 @@
"eslint": "^7.5.0",
"eslint-plugin-ember": "^8.9.2",
"eslint-plugin-node": "^11.1.0",
"faker": "^4.1.0",
"lerna-changelog": "^1.0.1",
"loader.js": "^4.7.0",
"npm-run-all": "^4.1.5",
Expand Down
24 changes: 12 additions & 12 deletions tests/dummy/mirage/factories/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@
Create more files in this directory to define additional factories.
*/
import { Factory } from 'ember-cli-mirage';
import faker from 'faker';
import { faker } from '@faker-js/faker';

faker.locale = 'en_US';

const MATERIAL_UI_COLORS = ['#F44336', '#E91E63', '#9C27B0', '#009688', '#2196F3', '#4CAF50', '#FFC107', '#FF5722', '#607D8B'];

export default Factory.extend({
firstName: faker.name.firstName,
lastName: faker.name.firstName,
company: faker.company.companyName,
address: faker.address.streetAddress,
country: faker.address.country,
state: faker.address.state,
email: faker.internet.email,
username: faker.internet.userName,
avatar: faker.internet.avatar,
bio: faker.lorem.paragraph,
color: () => faker.random.arrayElement(MATERIAL_UI_COLORS)
firstName: () => faker.name.firstName(),
lastName: () => faker.name.firstName(),
company: () => faker.company.companyName(),
address: () => faker.address.streetAddress(),
country: () => faker.address.country(),
state: () => faker.address.state(),
email: () => faker.internet.email(),
username: () => faker.internet.userName(),
avatar: () => faker.internet.avatar(),
bio: () => faker.lorem.paragraph(),
color: () => faker.helpers.arrayElement(MATERIAL_UI_COLORS)
});
Loading

0 comments on commit 81ba515

Please sign in to comment.