Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import FactoryGuy from 'ember-data-factory-guy';
import faker from 'faker';
FactoryGuy.define('file', {
default: {
name: () => `${faker.lorem.words(1)}.txt`,
kind: 'file',
path: '/1234567890', // Faker.system.filePath may not yet be implemented
size: () => faker.random.number(),
provider: 'osfstorage',
materializedPath: () => `/${faker.lorem.words(1)}.png`,
lastTouched: null,
dateModified: () => faker.date.recent(1),
dateCreated: () => faker.date.past(1),
isProvider: false,
checkout: null,
links: {
import FactoryGuy from 'ember-data-factory-guy';
import faker from 'faker';
FactoryGuy.define('file-version', {
default: {
size: () => faker.random.number(),
contentType: 'text/plain', // faker.system may not come with older versions of lib
}
});
import FactoryGuy from 'ember-data-factory-guy';
import faker from 'faker';
FactoryGuy.define('file', {
default: {
name: () => faker.lorem.words(1) + '.txt',
kind: 'file',
path: '/1234567890', // Faker.system.filePath may not yet be implemented
size: () => faker.random.number(),
provider: 'osfstorage',
materializedPath: () => '/' + faker.lorem.words(1) + '.png',
lastTouched: null,
dateModified: () => faker.date.recent(1),
dateCreated: () => faker.date.past(1),
isProvider: false,
checkout: null,
links: {
import FactoryGuy from 'ember-data-factory-guy';
FactoryGuy.define('file-provider', {
default: {
name: 'osfstorage',
kind: 'folder',
path: '/',
provider: 'osfstorage',
node: FactoryGuy.belongsTo('node')
},
traits: {
hasFiles: {
files: () => FactoryGuy.hasMany('file', 3)
}
}
});
import FactoryGuy from 'ember-data-factory-guy';
FactoryGuy.define('mix-clip', {
default: {
},
});
import FactoryGuy from 'ember-data-factory-guy';
FactoryGuy.define('echonest/track', {
default: {},
'echonest/track-giveitupforlove': {
"status": "pending",
"artist": "EDX, John Williams",
"title": "Give It Up for Love feat. John Williams (Mysto & Pizzi Remix)",
"analyzer_version": "3.2.2",
"audio_summary": {
"time_signature": 4,
"tempo": 127.961,
"energy": 0.8598686482238894,
"liveness": 0.27259638737145886,
"analysis_url": "http://echonest-analysis.s3.amazonaws.com/TR/TRAWOGC14E8320817F/3/full.json?AWSAccessKeyId=AKIAJRDFEY23UEVW42BQ&Expires=1438821667&Signature=YBvry9SxwI8im4c5JlMRv57E4WE%3D",
"speechiness": 0.0898701891797693,
"mode": 0,
"acousticness": 0.03839232695391064,
"danceability": 0.5554706885700197,
import FactoryGuy from 'ember-data-factory-guy';
import faker from 'faker';
FactoryGuy.define('preprint', {
default: {
dateCreated: () => faker.date.past(2),
datePublished: () => faker.date.past(1),
dateModified: () => faker.date.recent(),
doi: () => `10.1000/${String(faker.random.number())}`,
node: FactoryGuy.belongsTo('node'),
license: FactoryGuy.belongsTo('license'),
primaryFile: FactoryGuy.belongsTo('file'),
provider: FactoryGuy.belongsTo('preprint-provider'),
isPublished: false,
isPreprintOrphan: false,
},
traits: {
hasBeenPublished: {
isPublished: true,
},
import FactoryGuy from 'ember-data-factory-guy'
FactoryGuy.define('list-item', {
sequences: {
label: (num) => {
let items = [
'foo',
'bar',
'biz',
'baz'
]
return items[num % items.length]
},
itemType: (num) => {
let items = [
'a',
'b',
'c',
'd'
import FactoryGuy from 'ember-data-factory-guy';
import faker from 'faker';
FactoryGuy.define('comment-report', {
default: {
category: () => faker.random.arrayElement(['hate', 'spam', 'violence']),
text: FactoryGuy.belongsTo('comment'),
},
});