I'm trying to make some test on a Sails app. So beforeEach test I need to lift my Sails like this :
// Reset database before each test
beforeEach(function(done) {
// Get instance of Sails
sails = Sails();
// Lift the app
sails.lift({
// configuration for testing purposes
hooks:{
// Don't call Grunt
grunt:false
}
}, function(err, server) {
if (err) return done(err);
// Should have heartbeat in global variable
// But is not in global
// So we hack it to get heartbeat
heartbeat = sails.services.heartbeat;
done(err, heartbeat);
});
});
But I see that is a little slowly. So I saw some people use Sails.load(). Does really have a difference between Sails.lift and Sails.load ? if yes, which one ?
Thank's !
Aucun commentaire:
Enregistrer un commentaire