@@ -77,7 +77,7 @@ describe('Error handling', () => {
7777 it ( 'should fail gracefully if an error is thrown inside the configuration function' , function ( done ) {
7878 this . slow ( 200 ) ;
7979 let error ;
80- storage = GridFsStorage ( {
80+ storage = new GridFsStorage ( {
8181 url : settings . mongoUrl ,
8282 file : ( ) => {
8383 throw new Error ( 'Error thrown' ) ;
@@ -106,7 +106,7 @@ describe('Error handling', () => {
106106 it ( 'should fail gracefully if an error is thrown inside a generator function' , function ( done ) {
107107 let error ;
108108
109- storage = GridFsStorage ( {
109+ storage = new GridFsStorage ( {
110110 url : settings . mongoUrl ,
111111 file : function * ( ) { // eslint-disable-line require-yield
112112 throw new Error ( 'File error' ) ;
@@ -147,7 +147,7 @@ describe('Error handling', () => {
147147 setTimeout ( ( ) => reject ( error ) , 200 ) ;
148148 } ) ;
149149
150- storage = GridFsStorage ( { db : promise } ) ;
150+ storage = new GridFsStorage ( { db : promise } ) ;
151151
152152 const upload = multer ( { storage} ) ;
153153
@@ -190,7 +190,7 @@ describe('Error handling', () => {
190190 return db . close ( ) . then ( ( ) => db ) ;
191191 } )
192192 . then ( db => {
193- storage = GridFsStorage ( { db} ) ;
193+ storage = new GridFsStorage ( { db} ) ;
194194 const upload = multer ( { storage} ) ;
195195
196196 app . post ( '/close' , upload . array ( 'photos' , 2 ) , ( err , req , res , next ) => {
@@ -230,7 +230,7 @@ describe('Error handling', () => {
230230 it ( 'should throw an error if the mongodb connection fails' , function ( done ) {
231231 const connectionSpy = sinon . spy ( ) ;
232232
233- storage = GridFsStorage ( {
233+ storage = new GridFsStorage ( {
234234 url : settings . mongoUrl ,
235235 } ) ;
236236
@@ -262,7 +262,7 @@ describe('Error handling', () => {
262262 throw generatedError ;
263263 } ) ;
264264
265- storage = GridFsStorage ( {
265+ storage = new GridFsStorage ( {
266266 url : settings . mongoUrl ,
267267 } ) ;
268268
0 commit comments