Create a directory called "fixtures" in the root of your project. Currently supports JavaScript and JSON file formats.
- Ranges,
Person_[1..100]
- Generators,
{{name.firstName}}
- see Faker.js for more methods
- Named Ranges,
Person_[Billy, Joe, Mary]
- Named References,
@Person_Billy.firstName
const User = require('../src/models/User');
module.exports = [
{
model: User,
map: {
'User_1': {
firstName: 'Jacob',
lastName: 'Dachenhaus',
email: 'jdachenhaus99@gmail.com',
password: 'testPassword'
},
'User_[1..10]': {
firstName: '{{name.firstName}}',
lastName: '{{name.lastName}}',
email: '{{internet.email}}',
password: '{{internet.password}}'
}
}
}
]
[
{
"model": "../src/models/User",
"map": {
"User_1": {
"firstName": "Jacob",
"lastName": "Dachenhaus",
"email": "jdachenhaus99@gmail.com",
"password": "testPassword"
},
"User_[1..10]": {
"firstName": "{{name.firstName}}",
"lastName": "{{name.lastName}}",
"email": "{{internet.email}}",
"password": "{{internet.password}}"
}
}
}
]