How to use the ember-data-factory-guy.generate function in ember-data-factory-guy

To help you get started, we’ve selected a few ember-data-factory-guy 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 linxmix / linx / tests / factories / track.js View on Github external
import FactoryGuy from 'ember-data-factory-guy';

FactoryGuy.define('track', {
  sequences: {
    title: function(num) {
      return 'track' + num;
    },
    artist: function(num) {
      return 'artist' + num;
    }
  },

  default: {
    title: FactoryGuy.generate('title'),
    artist: FactoryGuy.generate('artist'),
    _audioMeta: {},
    _echonestTrack: {},
  },

  traits: {
    'withoutAudioMeta': {
      _audioMeta: null,
      _echonestTrack: null,
    },

    'withSmallS3Url': {
      title: 'royals:s3',
      s3Url: 'songs/08042d60-c4d7-4014-bce1-f05e93340a1f.mp3',
    },
github ciena-frost / ember-frost-list / tests / factories / list-item.js View on Github external
]
      return items[num % items.length]
    },
    itemType: (num) => {
      let items = [
        'a',
        'b',
        'c',
        'd'
      ]
      return items[num % items.length]
    }
  },

  default: {
    label: FactoryGuy.generate('label'),
    itemType: FactoryGuy.generate('itemType')
  }
})
github ciena-frost / ember-frost-list / tests / factories / list-item.js View on Github external
return items[num % items.length]
    },
    itemType: (num) => {
      let items = [
        'a',
        'b',
        'c',
        'd'
      ]
      return items[num % items.length]
    }
  },

  default: {
    label: FactoryGuy.generate('label'),
    itemType: FactoryGuy.generate('itemType')
  }
})
github linxmix / linx / tests / factories / track.js View on Github external
import FactoryGuy from 'ember-data-factory-guy';

FactoryGuy.define('track', {
  sequences: {
    title: function(num) {
      return 'track' + num;
    },
    artist: function(num) {
      return 'artist' + num;
    }
  },

  default: {
    title: FactoryGuy.generate('title'),
    artist: FactoryGuy.generate('artist'),
    _audioMeta: {},
    _echonestTrack: {},
  },

  traits: {
    'withoutAudioMeta': {
      _audioMeta: null,
      _echonestTrack: null,
    },

    'withSmallS3Url': {
      title: 'royals:s3',
      s3Url: 'songs/08042d60-c4d7-4014-bce1-f05e93340a1f.mp3',
    },

    'withLocalFile': {