File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -227,7 +227,7 @@ function mockFacebook() {
227
227
function clearData ( ) {
228
228
var promises = [ ] ;
229
229
for ( var conn in DatabaseAdapter . dbConnections ) {
230
- promises . push ( DatabaseAdapter . dbConnections [ conn ] . deleteEverything ( ) ) ;
230
+ promises . push ( DatabaseAdapter . dbConnections [ conn ] . dropDatabase ( ) ) ;
231
231
}
232
232
return Promise . all ( promises ) ;
233
233
}
Original file line number Diff line number Diff line change @@ -364,14 +364,21 @@ ExportAdapter.prototype.deleteEverything = function() {
364
364
var promises = [ ] ;
365
365
for ( var coll of colls ) {
366
366
if ( ! coll . namespace . match ( / \. s y s t e m \. / ) &&
367
- coll . collectionName . indexOf ( this . collectionPrefix ) === 0 ) {
367
+ coll . collectionName . indexOf ( this . collectionPrefix ) === 0 ) {
368
368
promises . push ( coll . drop ( ) ) ;
369
369
}
370
370
}
371
371
return Promise . all ( promises ) ;
372
372
} ) ;
373
373
} ;
374
374
375
+ ExportAdapter . prototype . dropDatabase = ( ) => {
376
+ this . schemaPromise = null ;
377
+ return this . connect ( ) . then ( ( ) => {
378
+ return this . db . dropDatabase ( ) ;
379
+ } ) ;
380
+ } ;
381
+
375
382
// Finds the keys in a query. Returns a Set. REST format only
376
383
function keysForQuery ( query ) {
377
384
var sublist = query [ '$and' ] || query [ '$or' ] ;
You can’t perform that action at this time.
0 commit comments