-
-
Save rh0dium/cd6336977d2e74635f00 to your computer and use it in GitHub Desktop.
global declaration - Not working
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
/** | |
* Created by Steven Klass on 03/02/2015 | |
*/ | |
var Sails = global.sails = require('sails'); | |
var Barrels = require('barrels'); | |
require('should'); | |
// Global before hook | |
before(function (done) { | |
// Lift Sails with test database | |
Sails.lift({ | |
log: { | |
level: 'error' | |
}, | |
port: 1338, | |
models: { | |
connection: 'test', | |
migrate: 'drop' | |
} | |
}, function(err, sails) { | |
if (err) | |
return done(err); | |
// Load fixtures | |
var barrels = new Barrels(); | |
// Save original objects in `fixtures` variable | |
fixtures = barrels.data; | |
// Populate the DB | |
barrels.populate(function(err) { | |
done(err, sails); | |
}); | |
}); | |
}); | |
// Global after hook | |
after(function (done) { | |
console.log(); // Skip a line before displaying Sails lowering logs | |
sails.lower(done); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment