Merge branch 'master' into master

master
Michael Iacona 2018-11-13 17:43:45 -05:00 committed by GitHub
commit e4a068712d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 46 additions and 0 deletions

View File

@ -11,6 +11,8 @@
"async": "2.0.1",
"base64url": "^3.0.0",
"bcrypt": "^3.0.2",
"chai": "^4.2.0",
"eslint-plugin-react": "^7.11.1",
"express-rate-limit": "^3.2.1",
"forever": "^0.15.3",
"grunt": "^1.0.3",
@ -36,6 +38,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",
@ -75,5 +78,15 @@
"globals": [
"sails"
]
"sails",
"User",
"Book",
"Passport",
"_"
],
"env": [
"mocha"
],
"parser": "babel-eslint"
}
}

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)
})