1 | 'use strict';
|
2 |
|
3 | var mongoose = require('mongoose');
|
4 | var path = require('path');
|
5 | var Mockgoose = require(path.join(__dirname, '../built/mockgoose')).Mockgoose;
|
6 | var expect = require('chai').expect;
|
7 |
|
8 | var mockgoose = new Mockgoose(mongoose);
|
9 |
|
10 |
|
11 | describe('bug 179', function() {
|
12 | before(function(done) {
|
13 | mockgoose.prepareStorage().then(function() {
|
14 | mongoose.connect('mongodb://foobar:27017/test', { useNewUrlParser: true }, function() {
|
15 | done();
|
16 | });
|
17 | });
|
18 | });
|
19 |
|
20 | it('should throw an error', function(done) {
|
21 | expect(function() {
|
22 | require('this-module-not-found');
|
23 | }).to.throw(/Cannot find module/);
|
24 | done();
|
25 | });
|
26 | });
|