Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .depcheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ ignores:
- '@babel/core'
- '@babel/parser'
- 'lerna'
# sinon is added to the root to ensure it is hoisted and shared across all workspaces
- 'sinon'
28,924 changes: 1,269 additions & 27,655 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"@babel/parser": "^7.22.7",
"depcheck": "^1.4.7",
"husky": "^9.1.7",
"lerna": "^9.0.7"
"lerna": "^9.0.7",
"sinon": "^21.1.2"
}
}
2 changes: 1 addition & 1 deletion packages/device-id/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"mocha": "^8.4.0",
"nyc": "^15.1.0",
"prettier": "^3.8.1",
"sinon": "^9.2.3",
"sinon": "^21.1.2",
"typescript": "^5.9.3"
}
}
2 changes: 1 addition & 1 deletion packages/devtools-connect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@
"nyc": "^15.1.0",
"os-dns-native": "^2.0.1",
"resolve-mongodb-srv": "^1.1.1",
"sinon": "^21.1.2",
"sinon-chai": "^4.0.1",
"ts-node": "^10.9.2",
"ts-sinon": "^2.0.1",
"typescript": "^5.9.3",
"prettier": "^3.8.1"
},
Expand Down
19 changes: 18 additions & 1 deletion packages/devtools-connect/src/connect.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,24 @@ import { isHumanOidcFlow } from './connect';
import { EventEmitter, once } from 'events';
import { MongoClient } from 'mongodb';
import { MongoClient as MongoClient6 } from 'mongodb6';
import sinon, { stubConstructor } from 'ts-sinon';
import sinon from 'sinon';

function stubConstructor<T extends object>(
Constructor: new (...args: any[]) => T,
): sinon.SinonStubbedInstance<T> {
const instance = new Constructor();
for (const key of Object.keys(instance)) {
if (typeof (instance as any)[key] === 'function') {
sinon.stub(instance as any, key);
}
}
for (const key of Object.getOwnPropertyNames(Constructor.prototype)) {
if (key !== 'constructor' && typeof (instance as any)[key] === 'function') {
sinon.stub(instance as any, key);
}
}
return instance as sinon.SinonStubbedInstance<T>;
}
import chai, { expect } from 'chai';
import sinonChai from 'sinon-chai';
import { Agent as HTTPSAgent } from 'https';
Expand Down
2 changes: 1 addition & 1 deletion packages/devtools-connect/src/ipc-rpc-state-share.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import chai, { expect } from 'chai';
import { PassThrough } from 'stream';
import sinon from 'ts-sinon';
import sinon from 'sinon';
import {
sign,
readSignedStream,
Expand Down
2 changes: 1 addition & 1 deletion packages/devtools-proxy-support/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"mocha": "^8.4.0",
"nyc": "^15.1.0",
"prettier": "^3.8.1",
"sinon": "^9.2.3",
"sinon": "^21.1.2",
"typescript": "^5.9.3",
"xvfb-maybe": "^0.2.1"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/dl-center/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"nyc": "^15.1.0",
"prettier": "^3.8.1",
"s3rver": "^3.7.1",
"sinon": "^9.2.3",
"sinon": "^21.1.2",
"typescript": "^5.9.3"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/download-url/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"mocha": "^8.4.0",
"nyc": "^15.1.0",
"prettier": "^3.8.1",
"sinon": "^9.2.3",
"sinon": "^21.1.2",
"typescript": "^5.9.3",
"ts-node": "^10.9.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/get-os-info/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"mocha": "^8.4.0",
"nyc": "^15.1.0",
"prettier": "^3.8.1",
"sinon": "^9.2.3",
"sinon": "^21.1.2",
"typescript": "^5.9.3"
}
}
2 changes: 1 addition & 1 deletion packages/mongodb-cloud-info/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"nock": "^14.0.12",
"nyc": "^15.1.0",
"prettier": "^3.8.1",
"sinon": "^9.2.3",
"sinon": "^21.1.2",
"ts-node": "^10.9.2",
"typescript": "^5.9.3"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/mongodb-constants/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"mocha": "^8.4.0",
"nyc": "^15.1.0",
"prettier": "^3.8.1",
"sinon": "^9.2.3",
"sinon": "^21.1.2",
"typescript": "^5.9.3"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/mongodb-downloader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"mocha": "^8.4.0",
"nyc": "^15.1.0",
"prettier": "^3.8.1",
"sinon": "^9.2.3",
"sinon": "^21.1.2",
"sinon-chai": "^4.0.1",
"typescript": "^5.9.3"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/mongodb-log-writer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"mocha": "^8.4.0",
"nyc": "^15.1.0",
"prettier": "^3.8.1",
"sinon": "^9.2.3",
"sinon": "^21.1.2",
"typescript": "^5.9.3"
}
}
2 changes: 1 addition & 1 deletion packages/mongodb-log-writer/src/mongo-log-manager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import path from 'path';
import os from 'os';
import { gunzip, constants as zlibConstants } from 'zlib';
import { promisify } from 'util';
import sinon from 'ts-sinon';
import sinon from 'sinon';
import { expect } from 'chai';

describe('MongoLogManager', function () {
Expand Down
2 changes: 1 addition & 1 deletion packages/mongodb-ns/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"mocha": "^8.4.0",
"nyc": "^15.1.0",
"prettier": "^3.8.1",
"sinon": "^9.2.3",
"sinon": "^21.1.2",
"typescript": "^5.9.3"
}
}
2 changes: 1 addition & 1 deletion packages/mongodb-redact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"mocha": "^8.4.0",
"nyc": "^15.1.0",
"prettier": "^3.8.1",
"sinon": "^9.2.3",
"sinon": "^21.1.2",
"typescript": "^5.9.3"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/mongodb-runner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"mocha": "^8.4.0",
"nyc": "^15.1.0",
"prettier": "^3.8.1",
"sinon": "^9.2.3",
"sinon": "^21.1.2",
"typescript": "^5.0.4"
}
}
2 changes: 1 addition & 1 deletion packages/mongodb-server-log-checker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"mongodb-runner": "^6.7.10",
"nyc": "^15.1.0",
"prettier": "^3.8.1",
"sinon": "^9.2.3",
"sinon": "^21.1.2",
"typescript": "^5.9.3"
}
}
2 changes: 1 addition & 1 deletion packages/mongodb-ts-autocomplete/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"mocha": "^8.4.0",
"nyc": "^15.1.0",
"prettier": "^3.8.1",
"sinon": "^9.2.3",
"sinon": "^21.1.2",
"ts-node": "^10.9.2"
}
}
2 changes: 1 addition & 1 deletion packages/monorepo-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"mocha": "^8.4.0",
"nyc": "^15.1.0",
"prettier": "^3.8.1",
"sinon": "^9.2.3",
"sinon": "^21.1.2",
"typescript": "^5.9.3"
},
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"mocha": "^8.4.0",
"nyc": "^15.1.0",
"prettier": "^3.8.1",
"sinon": "^9.2.3",
"sinon": "^21.1.2",
"typescript": "^5.9.3"
}
}
2 changes: 1 addition & 1 deletion packages/oidc-mock-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"mocha": "^8.4.0",
"nyc": "^15.1.0",
"prettier": "^3.8.1",
"sinon": "^9.2.3",
"sinon": "^21.1.2",
"typescript": "^5.9.3"
}
}
2 changes: 1 addition & 1 deletion packages/query-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"mocha": "^8.4.0",
"nyc": "^15.1.0",
"prettier": "^3.8.1",
"sinon": "^9.2.3",
"sinon": "^21.1.2",
"typescript": "^5.9.3"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/saslprep/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"mocha": "^8.4.0",
"nyc": "^15.1.0",
"prettier": "^3.8.1",
"sinon": "^9.2.3",
"sinon": "^21.1.2",
"typescript": "^5.9.3"
}
}
2 changes: 1 addition & 1 deletion packages/sbom-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"nyc": "^15.1.0",
"prettier": "^3.8.1",
"rimraf": "^6.1.3",
"sinon": "^9.2.3",
"sinon": "^21.1.2",
"typescript": "^5.9.3",
"webpack": "^5.82.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ async function runGenerateNotices(structure: Record<string, string>) {
describe('generate-third-party-notices', function () {
let clock: SinonFakeTimers;
before(function () {
clock = useFakeTimers(new Date('2023-01-01T12:00:00.468Z'));
clock = useFakeTimers({
now: new Date('2023-01-01T12:00:00.468Z'),
toFake: ['Date'],
});
});

after(function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,10 @@ patch: {}
process.env.JIRA_API_TOKEN = 'tok123';
process.env.JIRA_PROJECT = 'MY-PROJECT';
delete process.env.JIRA_VULNERABILITY_BUILD_INFO;
clock = useFakeTimers(new Date('2023-01-01T12:00:00.468Z'));
clock = useFakeTimers({
now: new Date('2023-01-01T12:00:00.468Z'),
toFake: ['Date'],
});
});

afterEach(function () {
Expand Down
2 changes: 1 addition & 1 deletion packages/shell-bson-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"mocha": "^8.4.0",
"nyc": "^15.1.0",
"prettier": "^3.8.1",
"sinon": "^9.2.3",
"sinon": "^21.1.2",
"typescript": "^5.9.3"
}
}
2 changes: 1 addition & 1 deletion packages/signing-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"mocha": "^8.4.0",
"nyc": "^15.1.0",
"prettier": "^3.8.1",
"sinon": "^9.2.3",
"sinon": "^21.1.2",
"typescript": "^5.9.3"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/ts-autocomplete/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@
"mocha": "^8.4.0",
"nyc": "^15.1.0",
"prettier": "^3.8.1",
"sinon": "^9.2.3"
"sinon": "^21.1.2"
}
}
Loading