Add error handling for when mongo is not running.

This commit is contained in:
Blade Barringer
2015-10-23 12:19:51 -05:00
parent 27d9e60d0f
commit 6492554cf1

View File

@@ -37,7 +37,8 @@ let testBin = (string) => {
};
gulp.task('test:prepare:mongo', (cb) => {
mongoose.connect(TEST_DB_URI, () => {
mongoose.connect(TEST_DB_URI, (err) => {
if (err) return cb(`Unable to connect to mongo database. Are you sure it's running? \n\n${err}`);
mongoose.connection.db.dropDatabase();
mongoose.connection.close();
cb();