Skip to content

Commit 9f50210

Browse files
committed
chore: add proper tests
1 parent 8bab148 commit 9f50210

File tree

5 files changed

+298
-120
lines changed

5 files changed

+298
-120
lines changed

package-lock.json

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/mongodb-downloader/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,25 @@
6666
"@mongodb-js/mocha-config-devtools": "^1.0.5",
6767
"@mongodb-js/prettier-config-devtools": "^1.0.2",
6868
"@mongodb-js/tsconfig-devtools": "^1.0.3",
69+
"@types/chai": "^4.2.21",
6970
"@types/debug": "^4.1.8",
7071
"@types/decompress": "^4.2.4",
7172
"@types/mocha": "^9.1.1",
7273
"@types/node": "^22.15.30",
7374
"@types/promise-retry": "^1.1.6",
7475
"@types/proper-lockfile": "^4.1.4",
7576
"@types/signal-exit": "^3.0.4",
77+
"@types/sinon-chai": "^3.2.5",
7678
"@types/tar": "^6.1.5",
79+
"chai": "^4.5.0",
7780
"depcheck": "^1.4.7",
7881
"eslint": "^7.25.0",
7982
"gen-esm-wrapper": "^1.1.3",
8083
"mocha": "^8.4.0",
8184
"nyc": "^15.1.0",
8285
"prettier": "^3.5.3",
86+
"sinon": "^9.2.3",
87+
"sinon-chai": "^3.7.0",
8388
"typescript": "^5.0.4"
8489
}
8590
}

packages/mongodb-downloader/src/download-locking.spec.ts

Lines changed: 0 additions & 117 deletions
This file was deleted.

packages/mongodb-downloader/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ export type MongoDBDownloaderOptions = {
3333
downloadOptions?: DownloadOptions;
3434
};
3535

36-
class MongoDBDownloader {
37-
// Download mongod + mongos and return the path to a directory containing them.
36+
export class MongoDBDownloader {
3837
async downloadMongoDbWithVersionInfo({
3938
downloadOptions = {},
4039
version,
@@ -236,6 +235,7 @@ async function withoutLock<T>(
236235

237236
const downloader = new MongoDBDownloader();
238237

238+
/** Download mongod + mongos with version info and return version info and the path to a directory containing them. */
239239
export async function downloadMongoDbWithVersionInfo({
240240
downloadOptions = {},
241241
version,
@@ -249,7 +249,7 @@ export async function downloadMongoDbWithVersionInfo({
249249
useLockfile,
250250
});
251251
}
252-
252+
/** Download mongod + mongos and return the path to a directory containing them. */
253253
export async function downloadMongoDb(
254254
...args: Parameters<typeof downloadMongoDbWithVersionInfo>
255255
): Promise<string> {

0 commit comments

Comments
 (0)