Skip to content

Instantly share code, notes, and snippets.

@luizcarraro
Created January 16, 2017 11:59
Show Gist options
  • Save luizcarraro/eebdc0f7f7729ffe20ecee0cc82e9996 to your computer and use it in GitHub Desktop.
Save luizcarraro/eebdc0f7f7729ffe20ecee0cc82e9996 to your computer and use it in GitHub Desktop.
Sails Bootstrap tests
var Sails = require('sails'),
_ = require('lodash');
global.DOMAIN = 'http://localhost';
global.PORT = 1337;
global.HOST = DOMAIN + ':' + PORT;
before(function(callback) {
this.timeout(50000);
configs = {
requireAccountActivation: false,
log: {
level: 'silent'
},
port: PORT,
environment: 'test',
// @TODO needs suport to csrf token
csrf: false,
hooks: {
grunt: false,
socket: false,
pubsub: false
}
};
Sails.lift(configs, function(err, sails) {
if (err) {
return callback(err);
}
callback(err, sails);
});
});
after(function(done) {
// sails.lower(done);
done();
});
--reporter spec
--colors
--timeout 10000
--require mocha-clean
"scripts": {
"debug": "node debug app.js",
"start": "node app.js",
"test": "mocha --opts tests/mocha.opts tests/bootstrap.test.js tests/**/*.test.js",
"coverage": "istanbul cover _mocha -- -t 10000 -R spec tests/bootstrap.test.js tests/**/*.test.js"
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment