-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
In mongodb-memory-server v10 the default mongodb binary was updated to v7 and mongodb has removed support for the ephemeralForTest engine
typegoose/mongodb-memory-server#889 (comment)
https://typegoose.github.io/mongodb-memory-server/docs/guides/migration/migrate10/#default-binary-version-is-now-7x
https://typegoose.github.io/mongodb-memory-server/docs/guides/mongodb-server-versions/#mongodb-memory-server-core-version-table
For now we can just use old mongodb binaries for tests, but eventually we may need to upgrade
The options seem to be
- Use wiredTiger engine on a RAM disk to run tests
mount -t tmpfs -o size=1G tmpfs /mnt/tmpfs
export MONGOMS_DBPATH=/mnt/tmpfs- Run a persistent MongoDB instance locally and test against it (add a script to start/stop it automatically)
mongod --dbpath ./testdata --port 27017beforeAll(async () => {
await mongoose.connect('mongodb://localhost:27017/testdb', {
useNewUrlParser: true,
useUnifiedTopology: true,
});
});
afterEach(async () => {
// Cleanup after each test to ensure isolation
await mongoose.connection.db.dropDatabase();
});
afterAll(async () => {
await mongoose.connection.close();
});Metadata
Metadata
Assignees
Labels
No labels