Jest environment with an in-memory MongoDB server running the EphemeralForTest storage engine


This package provides a wrapper around
jest-environment-mongodb
with the storageEngine setting preconfigured to ephemeralForTest.
This makes it possible to set the storage engine on a per test file basis via
docblocks, without setting up Jest projects.
NPM
``sh`
npm install --save-dev mongodb-memory-server jest-environment-mongodb-ephemeral
Yarn
`sh`
yarn add --dev mongodb-memory-server jest-environment-mongodb-ephemeral
By adding a @jest-environmentmongodb-ephemeral
docblock at
the top of a test file, you can specify to be used for all
tests in that file:
`js`
/**
* @jest-environment mongodb-ephemeral
*/
This overrides any environment set by testEnvironment in the Jest
configuration file.
Additionally, any instance.storageEngine option provided bytestEnvironmentOptions will be overridden with ephemeralForTest. All othertestEnvironmentOptions` will be in effect.
options provided by
- jest-environment-mongodb-wiredtiger
- jest-environment-mongodb