sailsjs-mocha-testing-barrels-fixtures-example
sailsjs-mocha-testing-barrels-fixtures-example copied to clipboard
Routing
All my Routes defined in config/routes always fail if i test with wallaby in Atom. If i run the same tests from terminal everything works as expected.
Even lift Sails from freeport with my routes won´t work var Barrels = require('barrels'); var routes = require('./config/routes');
freeport(function (err, port) {
if (err) throw err;
// Lift Sails with test database
global.sails = Sails.lift({
log: {
level: 'info'
},
models: {
connection: 'test',
migrate: 'drop'
},
routes: routes,
port: port
}, function (err) {
if (err) {
if (err) throw err;
wallaby.start();
}
// Load fixtures
var barrels = new Barrels();
// Save original objects in `fixtures` variable
fixtures = barrels.data;
// Populate the DB
barrels.populate(function (err) {
if (err) throw err;
wallaby.start();
});
});
});
Could you please create a sample repo with some failing tests so I could have a look? All tests in this repository are running ok with wallaby. Maybe also try this configuration file, either way let me know how it goes.