Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var promises = [];
while (today.isAfter(yearAgo)) {
var amount = faker.random.number(6); // between 0 and 5
for (var i = 0; i < amount; i++) {
var project = selectProject(),
wpm = (Math.random() * wpmRange[1]) + wpmRange[0],
duration = (Math.random() * durationRange[1]) + durationRange[0],
wordcount = Math.min(Math.floor(wpm * (duration / 60)), project.totalWordcount),
charcount = calcCharcount(wordcount);
project.totalWordcount -= wordcount;
promises.push(models.Session.create({
summary: faker.hacker.phrase(),
start: randomTime(today).toDate(),
duration: duration,
pausedTime: randomIntBetween(0, Math.floor(duration / 6)),
wordcount: wordcount,
charcount: charcount,
projectId: project.id,
isCountdown: !!faker.random.number(),
zoneOffset: today.utcOffset()
}));
}
today.subtract(1, 'day');
}
return promise.all(promises);
});
title: faker.name.firstName(),
rightTitle: faker.name.lastName(),
bgColor: randomColor({ luminosity: 'light', seed: randomSeed + i })
})
}
let items = []
for (let i = 0; i < itemCount; i++) {
const startDate = faker.date.recent(daysInPast).valueOf() + (daysInPast * 0.3) * 86400 * 1000
const startValue = Math.floor(moment(startDate).valueOf() / 10000000) * 10000000
const endValue = moment(startDate + faker.random.number({ min: 2, max: 20 }) * 15 * 60 * 1000).valueOf()
items.push({
id: i + '',
group: faker.random.number({ min: 1, max: groups.length }) + '',
title: faker.hacker.phrase(),
start: startValue,
end: endValue,
// canMove: startValue > new Date().getTime(),
// canResize: startValue > new Date().getTime() ? (endValue > new Date().getTime() ? 'both' : 'left') : (endValue > new Date().getTime() ? 'right' : false),
className: (moment(startDate).day() === 6 || moment(startDate).day() === 0) ? 'item-weekend' : '',
itemProps: {
'data-tip': faker.hacker.phrase()
}
})
}
items = items.sort((a, b) => b - a)
return { groups, items }
}
it('renders child text', () => {
assertRequired(Component, 'a `Component`')
const text = faker.hacker.phrase()
shallow(createElement(Component, requiredProps, text))
.should.contain.text(text)
})
const faker = require('faker');
const changeCase = require('change-case');
let termList = [];
for (let i = 0; i < 6; i++) {
const name = faker.hacker.noun();
const type = faker.hacker.noun();
const termObj = {
id: faker.random.number(100000),
termType: type,
termName: name,
termSlug: `${changeCase.paramCase(type)}-${changeCase.paramCase(name)}`,
createdAt: new Date(),
updatedAt: new Date()
};
termList.push(termObj);
}
module.exports = {
up: async (queryInterface) => {
await queryInterface.bulkInsert('Terms', termList, {});
},
const savedHomes = await this.saveAll([home]);
const medias = [];
for (let i = 2; i < 6; ++i) {
if (!row[i]) {
continue;
}
medias.push({
homeId: savedHomes[0].id.toString(),
originalname: faker.system.commonFileName('jpeg'),
mimetype: 'image/fake',
size: faker.random.number({min: 86400, max: 259200}),
url: row[i],
type: faker.hacker.noun(),
order: i,
caption: faker.random.word(),
isDeleted: false,
createdAt: DateTime.utc().toString(),
updatedAt: DateTime.utc().toString()
});
}
return [home, ...medias];
} catch (e) {
this.logger.debug(`address1, address2: ${address1}, ${address2}`);
this.logger.error(e.message, e.stack);
return [null, null];
}
}
}
export default function makeHashTagDummy(number = 100) {
const bulkHashTag = [];
for (let i = 0; i < number; ++i) {
const name = faker.hacker.ingverb();
const createdAt = faker.date.past(1);
const updatedAt = createdAt;
const EventId = faker.random.number({min: 1, max: EVENT_NUM});
bulkHashTag.push({name, createdAt, updatedAt, EventId});
}
return bulkHashTag;
}
function createRandomWords(count) {
const tags = []
for (let i = 0; i < count; i++) {
tags.push(faker.hacker.noun())
}
return uniq(tags)
}
const generateQuote = () => {
return `<section>${generateSentence()}</section><section><blockquote>${Faker.hacker.phrase()}</blockquote><p></p><p>${generateSentence()}</p></section>`;
};
exp.genPost = function() {
var post = {
title: faker.hacker.adjective() + ' ' + faker.hacker.noun(),
body: faker.lorem.paragraph(),
created_at: faker.date.future().getTime()
};
return post;
};
const generateStory = (apps = []) => ({
backgroundColor: `${faker.internet.color()}`,
date: faker.date.recent(10),
imageUrl: faker.image.imageUrl(),
legend: `${faker.hacker.ingverb()} ${faker.hacker.noun()}`,
title: faker.hacker.phrase(),
displayType: 'DEFAULT',
...faker.random.arrayElement([
{},
{},
{ app: faker.random.arrayElement(apps) },
{ apps: sampleSize(apps, 5 + faker.random.number(5)) },
]),
});