Merge pull request #3 from miacona96/testing

add test folders
pull/28/head
Michael Iacona 2018-11-08 16:09:52 -05:00 committed by GitHub
commit 56679bc92c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 0 deletions

View File

@ -38,6 +38,7 @@
"eslint": "^5.8.0",
"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)
})