add test folders
parent
8eb4d9b45b
commit
b800648c21
|
@ -20,7 +20,6 @@
|
||||||
"sails-hook-sockets": "^1.4.0"
|
"sails-hook-sockets": "^1.4.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@sailshq/eslint": "^4.19.3",
|
|
||||||
"@babel/core": "^7.1.2",
|
"@babel/core": "^7.1.2",
|
||||||
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
|
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
|
||||||
"@babel/polyfill": "^7.0.0",
|
"@babel/polyfill": "^7.0.0",
|
||||||
|
@ -31,6 +30,7 @@
|
||||||
"css-loader": "^1.0.1",
|
"css-loader": "^1.0.1",
|
||||||
"html-webpack-plugin": "^3.2.0",
|
"html-webpack-plugin": "^3.2.0",
|
||||||
"mini-css-extract-plugin": "^0.4.4",
|
"mini-css-extract-plugin": "^0.4.4",
|
||||||
|
"mocha": "^5.2.0",
|
||||||
"node-sass": "^4.9.4",
|
"node-sass": "^4.9.4",
|
||||||
"npm-run-all": "^4.1.3",
|
"npm-run-all": "^4.1.3",
|
||||||
"rimraf": "^2.6.2",
|
"rimraf": "^2.6.2",
|
||||||
|
|
|
@ -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)
|
||||||
|
})
|
Loading…
Reference in New Issue