Created
January 16, 2017 11:59
-
-
Save luizcarraro/eebdc0f7f7729ffe20ecee0cc82e9996 to your computer and use it in GitHub Desktop.
Sails Bootstrap tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--reporter spec | |
--colors | |
--timeout 10000 | |
--require mocha-clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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