Skip to content

Commit bbddd35

Browse files
committed
Merge branch 'beta' into master
2 parents 94ffc4b + 5bed129 commit bbddd35

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+3719
-2931
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ jobs:
1717
runs-on: ubuntu-latest
1818
strategy:
1919
matrix:
20-
node-version: [12.x, 14.x, 16.x]
20+
# TODO: replace "17.x" with "18.x" when 18 releases
21+
node-version: [12.x, 14.x, 16.x, 17.x]
2122
steps:
2223
- uses: actions/checkout@v2
2324
if: github.event.inputs.git-ref == ''

.releaserc.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,6 @@ module.exports = {
7979
pkgRoot: './packages/mongodb-memory-server-global',
8080
},
8181
],
82-
[
83-
'@semantic-release/npm',
84-
{
85-
npmPublish: true,
86-
pkgRoot: './packages/mongodb-memory-server-global-3.6',
87-
},
88-
],
8982
[
9083
'@semantic-release/npm',
9184
{

CHANGELOG.md

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,167 @@
1+
## [8.0.0-beta.11](https://github.com/nodkz/mongodb-memory-server/compare/v8.0.0-beta.10...v8.0.0-beta.11) (2021-11-01)
2+
3+
4+
### Features
5+
6+
* **errors:** add Error "StdoutInstanceError" ([382e7c6](https://github.com/nodkz/mongodb-memory-server/commit/382e7c68916a5fb661dd1a49415e49e5ed73d27f))
7+
* **MongoInstance::stdoutHandler:** change "instanceError" events to use "StdoutInstanceError" ([3daa5ea](https://github.com/nodkz/mongodb-memory-server/commit/3daa5ea1ff5b68eceb1722e29b1f15285587043a))
8+
* **MongoInstance::stdoutHandler:** change to handle "expection in initAndListen" ([7774e9e](https://github.com/nodkz/mongodb-memory-server/commit/7774e9e17055b59f64bc5bcd40cff3425bd2f606))
9+
10+
11+
### Dependencies
12+
13+
* **@types/semver:** upgrade to version 7.3.9 ([53f0354](https://github.com/nodkz/mongodb-memory-server/commit/53f0354bf5c8d5f060adca7efeed61c3613a23d4))
14+
* **@types/tar-stream:** upgrade to version 2.2.2 ([babce7f](https://github.com/nodkz/mongodb-memory-server/commit/babce7fb2dd2af082483129e568e38c35d88bc03))
15+
* **@types/tmp:** upgrade to version 0.2.2 ([8f5efe3](https://github.com/nodkz/mongodb-memory-server/commit/8f5efe34e92c4ff360cd776a61cc45d18b9f373c))
16+
* **@typescript-eslint/*:** upgrade to version 5.2.0 ([41f2a9a](https://github.com/nodkz/mongodb-memory-server/commit/41f2a9a0029884d10dced567a5f45b913011f65a))
17+
* **commitlint:** upgrade to version 14.1.0 ([5ea0921](https://github.com/nodkz/mongodb-memory-server/commit/5ea0921240a8f564003e7e8de7e75696bd658a1b))
18+
* **doctoc:** upgrade to version 2.1.0 ([8cb7243](https://github.com/nodkz/mongodb-memory-server/commit/8cb72437f52423e279c1d650e3e80569e8adb4be))
19+
* **eslint:** upgrade to version 8.1.0 ([6790a0c](https://github.com/nodkz/mongodb-memory-server/commit/6790a0c8284f3ebff42743697a719e7093aead12))
20+
* **husky:** upgrade to version 7.0.4 ([65a7042](https://github.com/nodkz/mongodb-memory-server/commit/65a70428d9b85cd1797466220991d22669648af3))
21+
* **jest:** upgrade to version 27.3.1 ([8577380](https://github.com/nodkz/mongodb-memory-server/commit/85773802a251a5257d666eb5cebc07d4a26e90fc))
22+
* **lint-staged:** upgrade to version 11.2.6 ([493d894](https://github.com/nodkz/mongodb-memory-server/commit/493d8942b640ad464a1910c6edc1822a1c0d24a4))
23+
* **mongodb:** upgrade to version 3.7.3 ([fcc2f70](https://github.com/nodkz/mongodb-memory-server/commit/fcc2f706f5d1066001dad6760b47ff084465ee4f))
24+
* **mongodb:** upgrade to version 4.1.3 ([9516bed](https://github.com/nodkz/mongodb-memory-server/commit/9516bedf9a2bd55bfe78b86528430f4c8a235f2a))
25+
* **ts-jest:** upgrade to version 27.0.7 ([9b0fb3c](https://github.com/nodkz/mongodb-memory-server/commit/9b0fb3cd295b873500f2323e8d949832c5aa1ea1))
26+
* **typescript:** upgrade to version 4.4.4 ([63606e4](https://github.com/nodkz/mongodb-memory-server/commit/63606e4186fc05f00ffe67abb7fbcc6d4b8cd76e))
27+
28+
## [8.0.0-beta.10](https://github.com/nodkz/mongodb-memory-server/compare/v8.0.0-beta.9...v8.0.0-beta.10) (2021-10-26)
29+
30+
31+
### ⚠ BREAKING CHANGES
32+
33+
* There is now no more "beforeExit" listener added
34+
35+
### Features
36+
37+
* remove all "beforeExit" listeners ([f3d8a19](https://github.com/nodkz/mongodb-memory-server/commit/f3d8a19161afd319be6acf877da1f131275e6e70)), closes [#563](https://github.com/nodkz/mongodb-memory-server/issues/563)
38+
39+
## [8.0.0-beta.9](https://github.com/nodkz/mongodb-memory-server/compare/v8.0.0-beta.8...v8.0.0-beta.9) (2021-10-22)
40+
41+
42+
### Fixes
43+
44+
* **DryMongoBinary::parseArchiveNameRegex:** change regex to include "macos" ([#562](https://github.com/nodkz/mongodb-memory-server/issues/562)) ([9d5bdbf](https://github.com/nodkz/mongodb-memory-server/commit/9d5bdbfb711223f36d284bd4f435c938cddb4a0c))
45+
46+
## [8.0.0-beta.8](https://github.com/nodkz/mongodb-memory-server/compare/v8.0.0-beta.7...v8.0.0-beta.8) (2021-10-20)
47+
48+
49+
### Features
50+
51+
* upgrade default mongodb binary version to 4.0.27 ([c82e56c](https://github.com/nodkz/mongodb-memory-server/commit/c82e56ce452f6859477f46c321cc6b44ac9e91ba))
52+
* upgrade mongodb patch version for "-global-*" packages ([01a6ded](https://github.com/nodkz/mongodb-memory-server/commit/01a6deda21ffe8c52e5b7ebbab532ab7ef88583e))
53+
54+
55+
### Style
56+
57+
* fix tsdoc "[@return](https://github.com/return)" -> "[@returns](https://github.com/returns)" ([ffbc0ca](https://github.com/nodkz/mongodb-memory-server/commit/ffbc0caa9bf67ff669a9369ba030ecae92f2f7dc))
58+
59+
60+
### Fixes
61+
62+
* **MongoInstance:** try to fix some CodeQL redos ([9fc3a33](https://github.com/nodkz/mongodb-memory-server/commit/9fc3a338326f9e0d3e511aff5794236ba133ac5d))
63+
64+
## [8.0.0-beta.7](https://github.com/nodkz/mongodb-memory-server/compare/v8.0.0-beta.6...v8.0.0-beta.7) (2021-10-19)
65+
66+
67+
### ⚠ BREAKING CHANGES
68+
69+
* **resolveConfig:** Default MongoDB Binary version is now "5.0.3"
70+
71+
### Features
72+
73+
* **resolveConfig:** upgrade default mongodb version to 5.0.3 ([75a722a](https://github.com/nodkz/mongodb-memory-server/commit/75a722ab12c6b8055be731fdd85634acb337a1e0)), closes [#555](https://github.com/nodkz/mongodb-memory-server/issues/555)
74+
75+
76+
### Fixes
77+
78+
* **resolveConfig:** change default version to be a constant (non-changeable) ([11c9547](https://github.com/nodkz/mongodb-memory-server/commit/11c95471ef7a400374491fe8055708a133f4ae6d))
79+
80+
## [8.0.0-beta.6](https://github.com/nodkz/mongodb-memory-server/compare/v8.0.0-beta.5...v8.0.0-beta.6) (2021-10-19)
81+
82+
83+
### Style
84+
85+
* **MongoInstance:** add more tsdoc ([36c1971](https://github.com/nodkz/mongodb-memory-server/commit/36c19715e7820a902f6533899b4a9ecd3cb91348))
86+
87+
88+
### Fixes
89+
90+
* add "@types/mongodb" to dependencies, because of exposing a mongodb type ([6346922](https://github.com/nodkz/mongodb-memory-server/commit/634692225201ed38e4fa306e40497a434ad6a4be)), closes [#558](https://github.com/nodkz/mongodb-memory-server/issues/558)
91+
* **MongoMemoryServer:** change that "instance.auth" is not required to be set for enabling auth ([4e4a41d](https://github.com/nodkz/mongodb-memory-server/commit/4e4a41d8d9975f8739ac0e92cdce040917e4d9cd))
92+
* **MongoMemoryServer:** change to log value "createAuth" ([9c3fea0](https://github.com/nodkz/mongodb-memory-server/commit/9c3fea0f08e875382c0c1e9dfd62a315aee8a2e1))
93+
* **resolveConfig:** fix debug enable ([aff6838](https://github.com/nodkz/mongodb-memory-server/commit/aff68382cb681b55516c053e9d4864d0b590ab25))
94+
* **resolveConfig::findPackageJson:** actually apply processing to path options ([25c4119](https://github.com/nodkz/mongodb-memory-server/commit/25c41195a245a0c22bba65c91b798cb088c5e885)), closes [#548](https://github.com/nodkz/mongodb-memory-server/issues/548)
95+
96+
## [8.0.0-beta.5](https://github.com/nodkz/mongodb-memory-server/compare/v8.0.0-beta.4...v8.0.0-beta.5) (2021-10-08)
97+
98+
99+
### Features
100+
101+
* **MongoBinaryDownloadUrl:** change to throw a error when debian 10 used for versions below 4.2.0 ([bfb0ec4](https://github.com/nodkz/mongodb-memory-server/commit/bfb0ec4c1ab8d8991bdf735d64cc130d7863f0a1)), closes [#554](https://github.com/nodkz/mongodb-memory-server/issues/554) [#448](https://github.com/nodkz/mongodb-memory-server/issues/448)
102+
103+
104+
### Style
105+
106+
* **MongoBinaryDownloadUrl:** add note for debian 11 ([81c85f1](https://github.com/nodkz/mongodb-memory-server/commit/81c85f1675fe3af549b4781fecb35c66e811a992))
107+
108+
## [8.0.0-beta.4](https://github.com/nodkz/mongodb-memory-server/compare/v8.0.0-beta.3...v8.0.0-beta.4) (2021-10-05)
109+
110+
111+
### Features
112+
113+
* **resolveConfig::findPackageJson:** re-write internals to be more maintainable ([8f16a2a](https://github.com/nodkz/mongodb-memory-server/commit/8f16a2a004a23f42b119ec96490b42a88eaded16))
114+
115+
116+
### Style
117+
118+
* **DryMongoBinary::generatePaths:** log options ([02befa8](https://github.com/nodkz/mongodb-memory-server/commit/02befa87016fc9384c89b07858fc83dbf05bdf0b))
119+
120+
## [8.0.0-beta.3](https://github.com/nodkz/mongodb-memory-server/compare/v8.0.0-beta.2...v8.0.0-beta.3) (2021-09-30)
121+
122+
123+
### Features
124+
125+
* replace "mkdirp" with "utils.mkdir" ([7579b47](https://github.com/nodkz/mongodb-memory-server/commit/7579b47aa61d4135ca8700f86a6c9c67419469b3))
126+
* **utils:** add function "mkdir" ([44eeb53](https://github.com/nodkz/mongodb-memory-server/commit/44eeb5393b994482740712c3130f02e7f1e90e56))
127+
128+
129+
### Dependencies
130+
131+
* **mkdirp:** remove unused dependency ([c078ae8](https://github.com/nodkz/mongodb-memory-server/commit/c078ae8a6777855bdada3461b9f6ea9750975de6))
132+
133+
## [8.0.0-beta.2](https://github.com/nodkz/mongodb-memory-server/compare/v8.0.0-beta.1...v8.0.0-beta.2) (2021-09-29)
134+
135+
136+
### Features
137+
138+
* **DryMongoBinary::generateOptions:** parse options from ARCHIVE_NAME or DOWNLOAD_URL ([808cc7e](https://github.com/nodkz/mongodb-memory-server/commit/808cc7e6566893ff4243420af718aa5514b72f72)), closes [#528](https://github.com/nodkz/mongodb-memory-server/issues/528)
139+
* **errors:** add errors "ParseArchiveRegexError" and "NoRegexMatchError" ([fb02eac](https://github.com/nodkz/mongodb-memory-server/commit/fb02eac6371c98ae1ff334db50d068be8ac5d843))
140+
* **MongoBinaryDownloadUrl::translateArch:** handle more variations of the same arch ([0a22679](https://github.com/nodkz/mongodb-memory-server/commit/0a22679d01a3792b6534b7de6c5d838c91c6646a))
141+
142+
143+
### Fixes
144+
145+
* **resolveConfig:** fix debug enable ([9c8cbb7](https://github.com/nodkz/mongodb-memory-server/commit/9c8cbb7674c05c978d0fcdc3c6123ecc9afc1fb0))
146+
147+
## [8.0.0-beta.1](https://github.com/nodkz/mongodb-memory-server/compare/v7.4.1...v8.0.0-beta.1) (2021-09-23)
148+
149+
150+
### ⚠ BREAKING CHANGES
151+
152+
* **mongodb:** Upgrade to mongodb(nodejs) 4.1
153+
154+
### Dependencies
155+
156+
* **@types/jest:** upgrade to version 27.0.2 ([e079f0d](https://github.com/nodkz/mongodb-memory-server/commit/e079f0d7af18e4a7a39b6c16b51a9dd39c910b8a))
157+
* **@typescript-eslint/*:** upgrade to version 4.31.2 ([c8d34b1](https://github.com/nodkz/mongodb-memory-server/commit/c8d34b1fb7b957a391fff93fc2f2013972492274))
158+
* **conventional-changelog-conventionalcommits:** upgrade to version 4.6.1 ([d00f6a9](https://github.com/nodkz/mongodb-memory-server/commit/d00f6a9b4fd6717292a3133dba77fa0ce878f4ce))
159+
* **jest:** upgrade to version 27.2.1 ([695527f](https://github.com/nodkz/mongodb-memory-server/commit/695527fb999cd2b16316dd6a240d2622b13c5b96))
160+
* **mongodb:** upgrade to version 4.1 ([6cf5502](https://github.com/nodkz/mongodb-memory-server/commit/6cf55023c2ace7448a80c88d6067f8dbb7742572))
161+
* **prettier:** upgrade to version 2.4.1 ([36cd70f](https://github.com/nodkz/mongodb-memory-server/commit/36cd70f13ba229a718a941a3f113170abf794c51))
162+
* **tslib:** upgrade to version 2.3.1 ([1a36352](https://github.com/nodkz/mongodb-memory-server/commit/1a36352fcaaa6c45796cb1d1c2a0e4b509acbfdd))
163+
* **typescript:** upgrade to version 4.4.3 ([84e407b](https://github.com/nodkz/mongodb-memory-server/commit/84e407b6b14ae986ab9d4ac6a1d5caa3f694861b))
164+
1165
## [7.6.0](https://github.com/nodkz/mongodb-memory-server/compare/v7.5.1...v7.6.0) (2021-10-31)
2166

3167

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Choose any package, because they are the same. They differ only in the default c
6969
### Requirements
7070

7171
- NodeJS: 12.22+
72-
- Typescript: 4.0+ (if used)
72+
- Typescript: 4.4+ (if used)
7373

7474
And one of those (on Linux):
7575

@@ -84,7 +84,7 @@ And one of those (on Linux):
8484

8585
### Configuring which mongod binary to use
8686

87-
The default behavior is that version `4.0.27` for your OS will be downloaded. By setting [Environment variables](https://nodkz.github.io/mongodb-memory-server/docs/api/config-options) you are able to specify which version and binary will be downloaded:
87+
The default behavior is that version `5.0.3` for your OS will be downloaded. By setting [Environment variables](https://nodkz.github.io/mongodb-memory-server/docs/api/config-options) you are able to specify which version and binary will be downloaded:
8888

8989
```sh
9090
export MONGOMS_DOWNLOAD_URL=https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1804-4.2.8.tgz
@@ -126,7 +126,7 @@ const mongod = new MongoMemoryServer({
126126
args?: string[], // by default no additional arguments, any additional command line arguments for `mongod` `mongod` (ex. ['--notablescan'])
127127
},
128128
binary: {
129-
version?: string, // by default '4.0.27'
129+
version?: string, // by default '5.0.3'
130130
downloadDir?: string, // by default node_modules/.cache/mongodb-memory-server/mongodb-binaries
131131
platform?: string, // by default os.platform()
132132
arch?: string, // by default os.arch()

docs/api/classes/mongo-memory-replset.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,6 @@ Typings: `async cleanup(force: boolean = false): Promise<void>`
8989

9090
Cleanup all files used by this ReplSet & instances
9191

92-
:::tip
93-
Runs automatically on `process.on('beforeExit')`
94-
:::
95-
9692
### waitUntilRunning
9793

9894
Typings: `async waitUntilRunning(): Promise<void>`

docs/api/classes/mongo-memory-server.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,6 @@ Typings: `async cleanup(force: boolean): Promise<void>`
8181

8282
Cleanup all files used by this instance
8383

84-
:::tip
85-
Runs automatically on `process.on('beforeExit')` [This can add many listeners if many instances are used without an replset]
86-
:::
87-
8884
### ensureInstance
8985

9086
Typings: `async ensureInstance(): Promise<MongoInstanceData>`

docs/api/config-options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Valid Options are `ia32`, `x64`, `arm64`
3939

4040
Option `VERSION` is used to set what mongodb version should be downloaded
4141

42-
Default: `4.0.27`
42+
Default: `5.0.3`
4343

4444
Common MongoDB Version formats (`X` is a number):
4545

docs/guides/faq.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ It is currently recommended to directly look at the TSDoc for these properties t
1313

1414
### Do testing database paths get cleaned up?
1515

16-
If the Database path is generated by this package, then it will automatically get cleaned up (ensured to run by process event `beforeExit`).
17-
If the Database path is provided, then it will not be automatically cleaned up, cleanup needs to be called explicitly like `.cleanup(true)` (parameter is to force-delete the directory).
16+
If the Database if a temporary directory (generated with `tmp`), then it will automatically get cleaned-up when calling `.stop()`, this can be disabled with `.stop(false)`.
17+
If the Database if manually set (set with `dbPath`), then it needs to be manually cleaned-up with `.cleanup(true)`.

docs/guides/integration-examples/test-runners.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export = async function globalSetup() {
5656
}
5757

5858
// The following is to make sure the database is clean before an test starts
59-
await mongoose.connect(`${process.env.MONGO_URI}/${config.DataBase}`, { useNewUrlParser: true, useUnifiedTopology: true });
59+
await mongoose.connect(`${process.env.MONGO_URI}/${config.DataBase}`, { });
6060
await mongoose.connection.db.dropDatabase();
6161
await mongoose.disconnect();
6262
};
@@ -131,10 +131,6 @@ describe('...', () => {
131131
});
132132
```
133133

134-
:::info
135-
Mocha may not call `process.on('exit')` events, resulting in temporary files persisting when using a storage engine that is not `ephemeralForTest`, see [Github Issue #530](https://github.com/nodkz/mongodb-memory-server/issues/530).
136-
:::
137-
138134
## AVA test runner
139135

140136
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.

docs/guides/migrate7.md renamed to docs/guides/migration/migrate7.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Until 7.0.0, `new` (`constructor`) automatically started the instance, which is
4545
This will make it easier to work with sharing the project folder (like host to docker)
4646

4747
:::note
48-
This package will **not** delete the old binaries, these need to be manually deleted, see [storage paths](../api/config-options.md#download_dir) for where binaries are stored
48+
This package will **not** delete the old binaries, these need to be manually deleted, see [storage paths](../../api/config-options.md#download_dir) for where binaries are stored
4949
:::
5050

5151
### getConnectionString got removed
@@ -90,7 +90,7 @@ This was changed to allow mongodb and mongoose URI's to work at the same time (t
9090

9191
### Config Values are now collected in an enum
9292

93-
Config values like `DOWNLOAD_DIR` are now collected in an enum called `ResolveConfigVariables`, [see more here](../api/config-options.md)
93+
Config values like `DOWNLOAD_DIR` are now collected in an enum called `ResolveConfigVariables`, [see more here](../../api/config-options.md)
9494

9595
### Config helper function "envName"
9696

0 commit comments

Comments
 (0)