You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* test on CI
* fix unit test
* fix prettier
* check that system binary exists
* fix unit tests
* refactor getPath method to consume several smaller methods
* update tests to excersize each smaller method individually
this also updates tests to use a mocked version of the
MongoBinaryDownloader so that we have a truelly issolated unit test...
* fix flow typing issues
* check system binary version against requested version
this is a fairly simple check and doesn't attempt to do any complex
version matching or resolution. It simply takes the value provided by
the system and checks strict equality with the version requested.
* update the README.md to include new option
also added a section explaining how to use mongodb-memory-server on a
system not officially supported by mongodb
* check that systemBinary exists before checking versions
Copy file name to clipboardExpand all lines: README.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,6 +63,7 @@ const mongod = new MongoMemoryServer({
63
63
arch?: string, // by default os.arch()
64
64
debug?: boolean, // by default false
65
65
skipMD5?: boolean, // by default false OR process.env.MONGOMS_SKIP_MD5_CHECK
66
+
systemBinary?: string, // by default undefined or process.env.MONGOMS_SYSTEM_BINARY
66
67
},
67
68
debug?: boolean, // by default false
68
69
autoStart?: boolean, // by default true
@@ -77,6 +78,7 @@ MONGOMS_VERSION=3
77
78
MONGOMS_DEBUG=1 # also available case-insensitive values:"on""yes""true"
78
79
MONGOMS_DOWNLOAD_MIRROR=url # your mirror url to download the mongodb binary
79
80
MONGOMS_DISABLE_POSTINSTALL=1 # if you want to skip download binaries on `npm i` command
81
+
MONGOMS_SYSTEM_BINARY=/usr/local/bin/mongod # if you want to use an existing binary already on your system.
80
82
MONGOMS_SKIP_MD5_CHECK=1 # if you want to skip MD5 check of downloaded binary.
81
83
# Passed constructor parameter `binary.skipMD5` has higher priority.
82
84
```
@@ -333,6 +335,11 @@ Additional examples of Jest tests:
333
335
### AVA test runner
334
336
For AVA written [detailed tutorial](https://github.com/zellwk/ava/blob/8b7ccba1d80258b272ae7cae6ba4967cd1c13030/docs/recipes/endpoint-testing-with-mongoose.md) how to test mongoose models by @zellwk.
335
337
338
+
### Docker Alpine
339
+
There isn't currently an official MongoDB release for alpine linux. This means that we can't pull binaries for Alpine
340
+
(or any other platform that isn't officially supported by MongoDB), but you can use a Docker image that already has mongod
341
+
built in and then set the MONGOMS_SYSTEM_BINARY variable to point at that binary. This should allow you to use
342
+
mongodb-memory-server on any system on which you can install mongod.
0 commit comments