5da134d074
This sets a default-but-query-configurable Faker seed in development, via faker-seed. It also changes uses of Math.random to use Faker’s randomness so auto-generated data remains stable in development.
17 lines
460 B
JavaScript
17 lines
460 B
JavaScript
import { Factory } from 'ember-cli-mirage';
|
|
import faker from 'nomad-ui/mirage/faker';
|
|
import { provide } from '../utils';
|
|
|
|
const REF_TIME = new Date();
|
|
const STATES = provide(10, faker.system.fileExt.bind(faker.system));
|
|
|
|
export default Factory.extend({
|
|
type: () => faker.helpers.randomize(STATES),
|
|
|
|
signal: () => '',
|
|
exitCode: () => null,
|
|
time: () => faker.date.past(2 / 365, REF_TIME) * 1000000,
|
|
|
|
displayMessage: () => faker.lorem.sentence(),
|
|
});
|