Skip to content

Commit

Permalink
add faker to devDependencies, set locale of faker to 'de'
Browse files Browse the repository at this point in the history
  • Loading branch information
Knut Behrends committed Oct 6, 2018
1 parent 78b4830 commit e0ea3d6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
8 changes: 8 additions & 0 deletions buildScripts/generateMockData.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ import { schema } from './mockDataSchema';
import fs from 'fs';
import chalk from 'chalk';

jsf.extend('faker', () => {
const faker = require('faker');

faker.locale = 'de'; // or any other language

return faker;
});

const json = JSON.stringify(jsf(schema));

fs.writeFile('./src/api/db.json', json, function(err) {
Expand Down
4 changes: 2 additions & 2 deletions buildScripts/mockDataSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ export const schema = {
properties: {
users: {
type: 'array',
minItems: 3,
maxItems: 5,
minItems: 30,
maxItems: 50,
items: {
type: 'object',
properties: {
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"eslint-watch": "^3.1.5",
"express": "^4.16.3",
"extract-text-webpack-plugin": "^3.0.2",
"faker": "^4.1.0",
"html-webpack-plugin": "3.2.0",
"jsdom": "7.2.2",
"json-schema-faker": "^0.5.0-rc15",
Expand Down

0 comments on commit e0ea3d6

Please sign in to comment.