UNPKG

804 BJavaScriptView Raw
1const mongoose = require('mongoose');
2const mockgoose = require('../mockgoose');
3const expect = require('chai').expect;
4
5mockgoose( mongoose )
6
7// Create the mongoose connection on init
8before(function(done) {
9 mongoose.connect('mongodb://example.com/TestingDB', function(err) {
10 done(err)
11 })
12});
13
14// Close the fake connection after all tests are done
15after(function(done) {
16 console.log('Closing') // Shows in console (always)
17 mongoose.connection.close(function() {
18 console.log('Closed') // Also. always shows in console
19 done()
20 })
21})
22
23
24describe('Foobar', function () {
25 describe('.createFoo', function () {
26 it( 'Creating foo with no data', function( done ) {
27 expect( null ).to.not.equal( null );
28 done();
29 })
30 });
31});