Skip to content

Commit 7ab06f2

Browse files
committed
Fixing tests after upgrading mongodb-memory-server
1 parent 2c58f07 commit 7ab06f2

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"email": "abraham@abranhe.com",
1111
"url": "https://abranhe.com"
1212
},
13+
"type": "module",
1314
"engines": {
1415
"node": ">=12"
1516
},

test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import test from 'ava';
22
import mongoose from 'mongoose';
3-
import mms from 'mongodb-memory-server';
4-
import nm from '.';
3+
import {MongoMemoryServer} from 'mongodb-memory-server';
4+
import nm from './index.js';
55

66
test('Main', async t => {
7-
const mongodb = new mms();
8-
mongoose.connect(await mongodb.getConnectionString(), {useNewUrlParser: true});
7+
const mongodb = await MongoMemoryServer.create();
8+
mongoose.connect(mongodb.getUri(), {useNewUrlParser: true});
99

1010
const personSchema = mongoose.Schema({
1111
name: String,

0 commit comments

Comments
 (0)