@@ -77,7 +77,7 @@ describe('Error handling', () => {
77
77
it ( 'should fail gracefully if an error is thrown inside the configuration function' , function ( done ) {
78
78
this . slow ( 200 ) ;
79
79
let error ;
80
- storage = GridFsStorage ( {
80
+ storage = new GridFsStorage ( {
81
81
url : settings . mongoUrl ,
82
82
file : ( ) => {
83
83
throw new Error ( 'Error thrown' ) ;
@@ -106,7 +106,7 @@ describe('Error handling', () => {
106
106
it ( 'should fail gracefully if an error is thrown inside a generator function' , function ( done ) {
107
107
let error ;
108
108
109
- storage = GridFsStorage ( {
109
+ storage = new GridFsStorage ( {
110
110
url : settings . mongoUrl ,
111
111
file : function * ( ) { // eslint-disable-line require-yield
112
112
throw new Error ( 'File error' ) ;
@@ -147,7 +147,7 @@ describe('Error handling', () => {
147
147
setTimeout ( ( ) => reject ( error ) , 200 ) ;
148
148
} ) ;
149
149
150
- storage = GridFsStorage ( { db : promise } ) ;
150
+ storage = new GridFsStorage ( { db : promise } ) ;
151
151
152
152
const upload = multer ( { storage} ) ;
153
153
@@ -190,7 +190,7 @@ describe('Error handling', () => {
190
190
return db . close ( ) . then ( ( ) => db ) ;
191
191
} )
192
192
. then ( db => {
193
- storage = GridFsStorage ( { db} ) ;
193
+ storage = new GridFsStorage ( { db} ) ;
194
194
const upload = multer ( { storage} ) ;
195
195
196
196
app . post ( '/close' , upload . array ( 'photos' , 2 ) , ( err , req , res , next ) => {
@@ -230,7 +230,7 @@ describe('Error handling', () => {
230
230
it ( 'should throw an error if the mongodb connection fails' , function ( done ) {
231
231
const connectionSpy = sinon . spy ( ) ;
232
232
233
- storage = GridFsStorage ( {
233
+ storage = new GridFsStorage ( {
234
234
url : settings . mongoUrl ,
235
235
} ) ;
236
236
@@ -262,7 +262,7 @@ describe('Error handling', () => {
262
262
throw generatedError ;
263
263
} ) ;
264
264
265
- storage = GridFsStorage ( {
265
+ storage = new GridFsStorage ( {
266
266
url : settings . mongoUrl ,
267
267
} ) ;
268
268
0 commit comments