Skip to content

Instantly share code, notes, and snippets.

@fnakstad
Last active December 19, 2015 23:18
Show Gist options
  • Select an option

  • Save fnakstad/6033342 to your computer and use it in GitHub Desktop.

Select an option

Save fnakstad/6033342 to your computer and use it in GitHub Desktop.
beforeEach(function(done) {
// ...
// Reset collections
User.remove().exec()
.then(function() { return Exercise.remove().exec() })
.then(function() { return WorkoutTemplate.remove().exec() })
// Seed
.then(function() { return User.seed(require('../scaffolds/users.json')) })
.then(function() { returnExercise.seed(require('../scaffolds/exercises.json')); })
.then(function() { return WorkoutTemplate.seed(require('../scaffolds/workoutTemplates.json')); })
// Finito!
.then(function() { done(); }, function(err) { return done(err); });
// ...
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment