Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Stripe Test Card Numbers
// https://stripe.com/docs/testing#cards
export default Factory.extend({
brand: faker.list.cycle(
'American Express',
'Diners Club',
'Discover',
'JCB',
'MasterCard',
'Visa'
),
expMonth: '01',
expYear: '2022',
last4: faker.list.cycle(
'0005',
'5904',
'1117',
'0000',
'4444',
'4242'
)
});
pack(i) { return faker.list.random('crips','bloods','nada')(i); },
avatar() { return faker.image.avatar(); },
dimension: function () {
type = faker.list.random('NC', 'SERVICE', 'custom')()
return type
},
label: faker.list.random('G4336-7NCP31', 'OTN/10GE/G4218-2NCP06/G4218-2NCP07/20005', '4-Node OPS'),
const generateDimensionExhausted = generateCountMap(1, ['cpu', 'mem', 'disk', 'iops']);
const generateQuotaExhausted = generateDimensionExhausted;
const generateScores = generateCountMap(1, ['binpack', 'job-anti-affinity']);
const generateConstraintFiltered = generateCountMap(2, [
'prop = val',
'driver = docker',
'arch = x64',
]);
export default Factory.extend({
id: () => faker.random.uuid(),
priority: () => faker.random.number(100),
type: faker.list.random(...EVAL_TYPES),
triggeredBy: faker.list.random(...EVAL_TRIGGERED_BY),
status: faker.list.random(...EVAL_STATUSES),
statusDescription: () => faker.lorem.sentence(),
failedTGAllocs: null,
modifyIndex: () => faker.random.number({ min: 10, max: 2000 }),
withPlacementFailures: trait({
status: 'blocked',
afterCreate(evaluation, server) {
assignJob(evaluation, server);
const taskGroups = server.db.taskGroups.where({ jobId: evaluation.jobId });
const taskGroupNames = taskGroups.mapBy('name');
const failedTaskGroupsCount = faker.random.number({ min: 1, max: taskGroupNames.length });
const failedTaskGroupNames = [];
import { Factory, faker, trait } from 'ember-cli-mirage';
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.list.random(...STATES),
signal: () => '',
exitCode: () => null,
time: () => faker.date.past(2 / 365, REF_TIME) * 1000000,
displayMessage: () => faker.lorem.sentence(),
});
value: (i) => {
const fieldIdentifierIsId = i % 2;
return faker.list.random(...(fieldIdentifierIsId ? idIds : nonIdIds))();
},
confidence: Math.random()
import Mirage, {faker} from 'ember-cli-mirage';
export default Mirage.Factory.extend({
title(i) { return `Todo title ${i + 1}`; },
complete: faker.list.random(true, false)
});
statecode(i) {
return faker.list.random('Active', 'Inactive')(i);
},
fullname(i) {
return faker.list.random('QN BB', 'MN BP', 'BK CB14')(i);
},
ageRating() { return faker.list.random('G', 'PG', 'R', 'R18')(); },
ageRatingGuide: '',