Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import Mirage, {faker} from 'ember-cli-mirage';
export default Mirage.Factory.extend({
address: faker.address.streetAddress,
company: function(i) {
let id = i + 1;
return id;
},
city: function(i) {
let id = i + 1;
return id;
},
});
import Mirage, { faker } from 'ember-cli-mirage';
export default Mirage.Factory.extend({
name: faker.name.findName(),
lat: faker.address.latitude(),
long: faker.address.longitude(),
email: faker.internet.email(),
zoom: 3,
birthdate: faker.date.past(),
avatar_id: function(i) {
return i + 1;
}
});
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)
});
import Mirage, { faker } from 'ember-cli-mirage';
export default Mirage.Factory.extend({
name: faker.address.city,
office: function(i) {
let office = {
id: i + 1,
address: faker.address.country(),
city: i + 1,
company: i + 1
};
return office;
}
});
import Mirage, { faker } from 'ember-cli-mirage';
export default Mirage.Factory.extend({
name: faker.name.findName(),
lat: faker.address.latitude(),
long: faker.address.longitude(),
email: faker.internet.email(),
zoom: 3,
birthdate: faker.date.past(),
avatar_id: function(i) {
return i + 1;
}
});
office: function(i) {
let office = {
id: i + 1,
address: faker.address.country(),
city: i + 1,
company: i + 1
};
return office;
}
});
location() { return faker.address.country(); },
password() { return faker.internet.password(); },
location() {
return faker.random.arrayElement([
`${faker.address.city()}, ${faker.address.stateAbbr()}, USA`,
`${faker.address.city()}, ${faker.address.country()}`,
]);
},
startDate() {
dcpProjectname() {
return `
${faker.random.arrayElement([faker.address.streetName(), faker.company.companyName()])}
${faker.random.arrayElement(['Rezoning', faker.address.streetSuffix()])}
`;
},
name() {
return faker.address.country();
},
});