How to use the ember-cli-mirage.Factory 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 travis-ci / travis-web / mirage / factories / log.js View on Github external
import Mirage/* , {faker} */ from 'ember-cli-mirage';

export default Mirage.Factory.extend({
  content: 'Hello log\nSecond line'
});
github offirgolan / ember-light-table / tests / dummy / mirage / factories / user.js View on Github external
/*
  This is an example factory definition.

  Create more files in this directory to define additional factories.
*/
import Mirage, { faker } from 'ember-cli-mirage';

faker.locale = 'en_US';

const MATERIAL_UI_COLORS = ['#F44336', '#E91E63', '#9C27B0', '#009688', '#2196F3', '#4CAF50', '#FFC107', '#FF5722', '#607D8B'];

export default Mirage.Factory.extend({
  firstName: faker.name.firstName,
  lastName: faker.name.firstName,
  company: faker.company.companyName,
  address: faker.address.streetAddress,
  country: faker.address.country,
  state: faker.address.state,
  email: faker.internet.email,
  username: faker.internet.userName,
  avatar: faker.internet.avatar,
  bio: faker.lorem.paragraph,
  color: () => faker.random.arrayElement(MATERIAL_UI_COLORS)
});
github BookingSync / ember-data-partial-model / tests / dummy / app / mirage / factories / user_extended.js View on Github external
import Mirage from 'ember-cli-mirage';

export default Mirage.Factory.extend({
  name: i => `User ${i}`,
  twitter: i => `@user-${i}`,
  clients: []
});
github aupac / ember-aupac-typeahead / tests / dummy / mirage / factories / employee.js View on Github external
import Mirage/*, {faker} */ from 'ember-cli-mirage';

export default Mirage.Factory.extend({
	name(i) {return `Employee ${i}`;}
});
github ilios / frontend / app / mirage / factories / learningMaterialUserRole.js View on Github external
import Mirage from 'ember-cli-mirage';

export default Mirage.Factory.extend({
  title: (i) => `role ${i}`,
});
github TryGhost / Ghost-Admin / app / mirage / factories / user.js View on Github external
import Mirage from 'ember-cli-mirage';

export default Mirage.Factory.extend({
    accessibility() { return null; },
    bio() { return null; },
    cover() { return null; },
    created_at() { return '2015-09-02T13:41:50.000Z'; },
    created_by() { return null; },
    email(i) { return `user-${i}@example.com`; },
    image() { return '//www.gravatar.com/avatar/3ae045bc198a157401827c8455cd7c99?s=250&d=mm&r=x'; },
    language() { return 'en_US'; },
    last_login() { return '2015-11-02T16:12:05.000Z'; },
    location() { return null; },
    meta_description() { return null; },
    meta_title() { return null; },
    name(i) { return `User ${i}`; },
    slug(i) { return `user-${i}`; },
    status() { return 'active'; },
    tour() { return null; },
github ilios / frontend / app / mirage / factories / schoolevent.js View on Github external
import Mirage from 'ember-cli-mirage';

export default Mirage.Factory.extend({
  name:  (i) => `event ${i}`,
  isPublished: false,
  isScheduled: false,
  instructors: []
});
github ilios / frontend / mirage / factories / curriculumInventorySequence.js View on Github external
import Mirage from 'ember-cli-mirage';

export default Mirage.Factory.extend({
  description: (i) => `descirption for sequence ${i} `,
  report: (i) => (i+1),
});
github ember-cli / ember-twiddle / mirage / factories / gist-file.js View on Github external
/**
 * This is a factory definition for a gist file
 */
import Mirage from 'ember-cli-mirage';

export default Mirage.Factory.extend({
  type() {
    if (!this.filename) {
      return "";
    }
    let extension = this.filename.substring(this.filename.lastIndexOf("."), this.filename.length);
    switch (extension) {
      case ".hbs":
        return "text/plain";
      case ".css":
        return "text/css";
      case ".js":
        return "application/javascript";
      case ".json":
        return "application/json";
    }
  },
github travis-ci / travis-web / mirage / factories / log.js View on Github external
import Mirage/*, {faker} */ from 'ember-cli-mirage';

export default Mirage.Factory.extend({
  content: 'Hello log'
});