File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
docs/guides/integration-examples Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -114,12 +114,11 @@ import mongoose from 'mongoose';
114114import { MongoMemoryServer } from ' mongodb-memory-server' ;
115115
116116let mongoServer;
117- const opts = { useMongoClient: true }; // remove this option if you use mongoose 5 and above
118117
119118before (async () => {
120119 mongoServer = await MongoMemoryServer .create ();
121120 const mongoUri = mongoServer .getUri ();
122- await mongoose .connect (mongoUri , opts );
121+ await mongoose .connect (mongoUri );
123122});
124123
125124after (async () => {
@@ -130,7 +129,7 @@ after(async () => {
130129describe (' ...' , () => {
131130 it (' ...' , async () => {
132131 const User = mongoose .model (' User' , new mongoose .Schema ({ name: String }));
133- const cnt = await User .count ();
132+ const cnt = await User .countDocuments ();
134133 expect (cnt ).to .equal (0 );
135134 });
136135});
You can’t perform that action at this time.
0 commit comments