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.
18 lines
476 B
JavaScript
18 lines
476 B
JavaScript
import { Factory } from 'ember-cli-mirage';
|
|
import faker from 'nomad-ui/mirage/faker';
|
|
import { generateResources } from '../common';
|
|
|
|
const DRIVERS = ['docker', 'java', 'rkt', 'qemu', 'exec', 'raw_exec'];
|
|
|
|
export default Factory.extend({
|
|
// Hidden property used to compute the Summary hash
|
|
groupNames: [],
|
|
|
|
JobID: '',
|
|
|
|
name: id => `task-${faker.hacker.noun().dasherize()}-${id}`,
|
|
driver: () => faker.helpers.randomize(DRIVERS),
|
|
|
|
Resources: generateResources,
|
|
});
|