add test folders

pull/22/head
unknown 2018-10-29 20:03:47 -04:00
parent 8eb4d9b45b
commit b800648c21
2 changed files with 34 additions and 1 deletions

View File

@ -20,7 +20,6 @@
"sails-hook-sockets": "^1.4.0"
},
"devDependencies": {
"@sailshq/eslint": "^4.19.3",
"@babel/core": "^7.1.2",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/polyfill": "^7.0.0",
@ -31,6 +30,7 @@
"css-loader": "^1.0.1",
"html-webpack-plugin": "^3.2.0",
"mini-css-extract-plugin": "^0.4.4",
"mocha": "^5.2.0",
"node-sass": "^4.9.4",
"npm-run-all": "^4.1.3",
"rimraf": "^2.6.2",

33
test/lifecycle.test.js Normal file
View File

@ -0,0 +1,33 @@
var sails = require('sails')
// Before running any tests...
before(function (done) {
// Increase the Mocha timeout so that Sails has enough time to lift, even if you have a bunch of assets.
this.timeout(5000)
sails.lift({
// Your sails app's configuration files will be loaded automatically,
// but you can also specify any other special overrides here for testing purposes.
// For example, we might want to skip the Grunt hook,
// and disable all logs except errors and warnings:
hooks: { grunt: false },
log: { level: 'warn' }
}, function (err) {
if (err) { return done(err) }
// here you can load fixtures, etc.
// (for example, you might want to create some records in the database)
return done()
})
})
// After all tests have finished...
after(function (done) {
// here you can clear fixtures, etc.
// (e.g. you might want to destroy the records you created above)
sails.lower(done)
})