mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-13 15:38:59 +00:00
Add error handling for when mongo is not running.
This commit is contained in:
parent
27d9e60d0f
commit
6492554cf1
1 changed files with 2 additions and 1 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue