How to use the ember-cli-mirage.faker.list function in ember-cli-mirage

To help you get started, we’ve selected a few ember-cli-mirage examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github code-corps / code-corps-ember / mirage / factories / stripe-platform-card.js View on Github external
// 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'
  )
});
github lifegadget / ui-selectize / tests / dummy / mirage / factories / animal.js View on Github external
  pack(i) { return faker.list.random('crips','bloods','nada')(i); },
  avatar() { return faker.image.avatar(); },
github ciena-frost / ember-frost-list / tests / dummy / mirage / factories / listItem.js View on Github external
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'),
github hashicorp / levant / vendor / github.com / hashicorp / nomad / ui / mirage / factories / evaluation.js View on Github external
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 = [];
github hashicorp / levant / vendor / github.com / hashicorp / nomad / ui / mirage / factories / task-event.js View on Github external
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(),
});
github linkedin / WhereHows / wherehows-web / mirage / factories / compliance-suggestion.js View on Github external
value: (i) => {
      const fieldIdentifierIsId = i % 2;
      return faker.list.random(...(fieldIdentifierIsId ? idIds : nonIdIds))();
    },
    confidence: Math.random()
github geekygrappler / ember-cli-todo-mvc / mirage / factories / todo.js View on Github external
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)
});
github NYCPlanning / labs-zap-search / mirage / factories / disposition.js View on Github external
statecode(i) {
    return faker.list.random('Active', 'Inactive')(i);
  },
github NYCPlanning / labs-zap-search / mirage / factories / disposition.js View on Github external
fullname(i) {
    return faker.list.random('QN BB', 'MN BP', 'BK CB14')(i);
  },
github hummingbird-me / hummingbird-client / mirage / factories / anime.js View on Github external
  ageRating() { return faker.list.random('G', 'PG', 'R', 'R18')(); },
  ageRatingGuide: '',