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
Copy file name to clipboardExpand all lines: README.md
+50-31Lines changed: 50 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,8 @@ Every `MongoMemoryServer` instance creates and starts fresh MongoDB server on so
15
15
Perfectly [works with Travis CI](https://github.com/nodkz/graphql-compose-mongoose/commit/7a6ac2de747d14281f9965f418065e97a57cfb37) without additional `services` and `addons` options in `.travis.yml`.
For additional information I recommend you to read this article [Testing a GraphQL Server using Jest with Mongoose](https://medium.com/entria/testing-a-graphql-server-using-jest-4e00d0e4980e)
175
181
182
+
For additional information I recommend you to read this article [Testing a GraphQL Server using Jest with Mongoose](https://medium.com/entria/testing-a-graphql-server-using-jest-4e00d0e4980e)
- simple example with `mongodb` in [tests in current package](https://github.com/nodkz/mongodb-memory-server/blob/master/src/__tests__/)
336
350
- more complex example with `mongoose` in [graphql-compose-mongoose](https://github.com/nodkz/graphql-compose-mongoose/blob/master/src/__mocks__/mongooseCommon.js)
337
351
338
352
### AVA test runner
353
+
339
354
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.
340
355
341
356
### Docker Alpine
342
-
There isn't currently an official MongoDB release for alpine linux. This means that we can't pull binaries for Alpine
357
+
358
+
There isn't currently an official MongoDB release for alpine linux. This means that we can't pull binaries for Alpine
343
359
(or any other platform that isn't officially supported by MongoDB), but you can use a Docker image that already has mongod
344
360
built in and then set the MONGOMS_SYSTEM_BINARY variable to point at that binary. This should allow you to use
345
361
mongodb-memory-server on any system on which you can install mongod.
@@ -348,14 +364,17 @@ mongodb-memory-server on any system on which you can install mongod.
348
364
349
365
**It is very important** to limit spawned number of Jest workers for avoiding race condition. Cause Jest spawn huge amount of workers for every node environment on same machine. [More details](https://github.com/facebook/jest/issues/3765)
350
366
Use `--maxWorkers 4` or `--runInBand` option.
367
+
351
368
```diff
352
369
script:
353
370
-- yarn run coverage
354
371
+- yarn run coverage ----maxWorkers 4
355
372
```
356
373
357
374
## Credits
375
+
358
376
Inspired by alternative runners for [mongodb-prebuilt](https://github.com/winfinit/mongodb-prebuilt):
0 commit comments