-
-
Save morintd/49324c4289ae55f88bb27edfc2ad4adb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { faker } = require('@faker-js/faker'); | |
function register(_requestParams, ctx, _ee, next) { | |
const id = faker.datatype.number(); | |
ctx.vars['email'] = faker.internet.email().split('@').join(`${id}@`); | |
ctx.vars['password'] = faker.internet.password(10); | |
return next(); | |
} | |
function generateArticle(_requestParams, ctx, _ee, next) { | |
const id = faker.datatype.hexadecimal({ length: 100 }); | |
ctx.vars['title'] = faker.lorem.word() + id; | |
ctx.vars['content'] = faker.lorem.sentence(1) + id; | |
return next(); | |
} | |
module.exports = { | |
register, | |
generateArticle, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment