Tests with fixtures data as JSON.
Install via npm:
$ npm install node-fixtures
The project will look for a directory named fixtures
which must be child of your test
directory in order to load all the fixtures (*.js or *.json files):
{
"dearwish": {
"name": "David",
"gender": "male"
},
"innaro": {
"name": "Inna",
"gender": "female"
}
}
[{
"rel": "loves",
"from": "dearwish",
"to": "innaro"
},{
"rel": "wife",
"from": "dearwish",
"to": "innaro"
},{
"rel": "husband",
"from": "innaro",
"to": "dearwish"
}]
var fx = require('node-fixtures');
fx.users.dearwish.name; // => "David"
fx.relations[0].rel; // => "loves"
fx.users.innaro.name; // => "Inna"
fx.reset();
MIT