node.js - Loading fixtures in sails tests -
the docs say
// here can load fixtures, etc.
i've worked out can include
var fixtures = require('./fixtures/models.js');
in bootstrap script, full bootstrap script is:
/* * lifts sails before testing comenses. */ var sails = require('sails'); var sails; before(function(done) { this.timeout(5000); sails.lift({ // configuration testing purposes environment: 'test', }, function(err, server) { sails = server; if (err) { return done(err); } // here can load fixtures, etc. var fixtures = require('./fixtures/models.js'); done(err, sails); }); }); after(function(done) { // here can clear fixtures, etc. sails.lower(done); });
i can reference fixtures var in boot script, can't reference in test. undefined.
Comments
Post a Comment