Comments (5)
I think that this difference in error messages depends on mongodb version.
If your testing and production versions of mongodb are the same, then you need to try make storageEngine the same. By default it is in memory.
So if it helps, please put here your solution for future googlers.
PS. You may spin app for some tests regular mongo instance, but for other tests - default in memory for spead.
from mongodb-memory-server.
Confirming that changing the engine to wiredTiger
(same as for production) gives the correct errmsg
.
new MongodbMemoryServer({
binary: {
version: '4.0.2',
},
instance: {
// Available engines:
// storageEngines: [ 'devnull', 'ephemeralForTest', 'mmapv1', 'wiredTiger' ],
storageEngine: 'wiredTiger',
},
});
from mongodb-memory-server.
@lirbank wow great!
Please open Pull Request for README.md - add links to your packages under Jest section.
Thanks!
from mongodb-memory-server.
Ok, cool! I have the same version but not the same engine. I'm going to try that. Keep you posted.
from mongodb-memory-server.
For future googlers:
I've published a package that enables you to set the storage engine per test file in Jest. It also enables you to keep a single mongodb-memory-server
server running between tests when you run Jest in watch mode, and other good stuff.
https://www.npmjs.com/package/jest-environment-mongodb (docs here)
https://www.npmjs.com/package/jest-environment-mongodb-wiredtiger
https://www.npmjs.com/package/jest-environment-mongodb-ephemeral
from mongodb-memory-server.
Related Issues (20)
- Consider supporting mongod option `--logpath` HOT 1
- Unable to connect to replica set running within Docker container HOT 1
- Can't connect to dockerized mongodb-memory-server replica set running as a service in GitLab HOT 11
- Change `forceSamePort` parameter to also be a config option
- oplogSize for replSet should be removed in README HOT 2
- Use RHEL 9 binaries HOT 2
- Add Support for "Rocky Linux 9" HOT 4
- [SOLUTION] Jest and Fake Timers HOT 1
- Amazon EC2 instance download failed, combination does not exist (403) HOT 4
- "getport" sometimes throwing an error HOT 41
- DownloadError: Download failed for url "https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-5.0.19.tgz" HOT 10
- Weird "db.watch" issue HOT 1
- postinstallHelper always installs to $HOME/.cache instead of node_modules/.cache HOT 6
- Enabling debug mode through package.json does not work HOT 3
- Randomizing db names for each test
- GridFS streams not working correctly HOT 4
- Jest + mongodb-memory-server + mongoose - Calling 'find' hangs indefinitely HOT 2
- Invalid version reported for version strings ending in -latest HOT 2
- Ubuntu >= 22.04 is unsupported when using MongoDB >= 6.0.4 HOT 7
- _startUpInstance threw a Error: TypeError: (intermediate value).finally is not a function HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mongodb-memory-server.