File tree Expand file tree Collapse file tree 1 file changed +22
-15
lines changed Expand file tree Collapse file tree 1 file changed +22
-15
lines changed Original file line number Diff line number Diff line change @@ -68,21 +68,28 @@ describe('mongoose-patch-history', () => {
68
68
Sport = mongoose . model ( 'Sport' , SportSchema )
69
69
User = mongoose . model ( 'User' , new Schema ( ) )
70
70
71
- mongoose . connect ( 'mongodb://localhost/mongoose-patch-history' , ( ) => {
72
- join (
73
- Comment . remove ( ) ,
74
- Comment . Patches . remove ( ) ,
75
- Fruit . remove ( ) ,
76
- Fruit . Patches . remove ( ) ,
77
- Sport . remove ( ) ,
78
- Sport . Patches . remove ( ) ,
79
- Post . remove ( ) ,
80
- Post . Patches . remove ( ) ,
81
- User . remove ( )
82
- )
83
- . then ( ( ) => User . create ( ) )
84
- . then ( ( ) => done ( ) )
85
- } )
71
+ mongoose
72
+ . connect ( 'mongodb://localhost/mongoose-patch-history' , {
73
+ useNewUrlParser : true ,
74
+ useCreateIndex : true ,
75
+ useUnifiedTopology : true ,
76
+ useFindAndModify : false ,
77
+ } )
78
+ . then ( ( ) => {
79
+ join (
80
+ Comment . deleteMany ( { } ) ,
81
+ Comment . Patches . deleteMany ( { } ) ,
82
+ Fruit . deleteMany ( { } ) ,
83
+ Fruit . Patches . deleteMany ( { } ) ,
84
+ Sport . deleteMany ( { } ) ,
85
+ Sport . Patches . deleteMany ( { } ) ,
86
+ Post . deleteMany ( { } ) ,
87
+ Post . Patches . deleteMany ( { } ) ,
88
+ User . deleteMany ( { } )
89
+ )
90
+ . then ( ( ) => User . create ( ) )
91
+ . then ( ( ) => done ( ) )
92
+ } )
86
93
} )
87
94
88
95
after ( ( ) => mongoose . connection . close ( ) )
You can’t perform that action at this time.
0 commit comments