Browse Source

Fix: error on test

Fix error of 'Trying to open unclosed connection'
Sotaro KARASAWA 9 years ago
parent
commit
c42a0344fd
2 changed files with 3 additions and 1 deletions
  1. 0 1
      test/bootstrap.js
  2. 3 0
      test/crowi/crowi.test.js

+ 0 - 1
test/bootstrap.js

@@ -1,7 +1,6 @@
 'use strict';
 
 var express = require('express')
-  , async = require('async')
   , ROOT_DIR = __dirname + '/..'
   , MODEL_DIR = __dirname + '/../lib/models'
   , testDBUtil

+ 3 - 0
test/crowi/crowi.test.js

@@ -37,6 +37,9 @@ describe('Test for Crowi application context', function () {
   });
 
   describe('.setupDatabase', function() {
+    before(function() {
+      mongoose.disconnect(); // avoid error of Trying to open unclosed connection
+    });
     it('setup completed', function(done) {
       var crowi = new Crowi(path.normalize(__dirname + '/../../'), process.env);
       // set