Skip to content

Commit 0511cb7

Browse files
build(deps-dev): bump sinon from 18.0.1 to 22.0.0 (#3149)
* build(deps-dev): bump sinon from 18.0.1 to 22.0.0 Bumps [sinon](https://github.com/sinonjs/sinon) from 18.0.1 to 22.0.0. - [Release notes](https://github.com/sinonjs/sinon/releases) - [Changelog](https://github.com/sinonjs/sinon/blob/main/docs/changelog.md) - [Commits](sinonjs/sinon@v18.0.1...v22.0.0) --- updated-dependencies: - dependency-name: sinon dependency-version: 22.0.0 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps-dev): update @types/sinon to 21.0.1 and fix fake timer test leaks --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 9d14495 commit 0511cb7

4 files changed

Lines changed: 37 additions & 82 deletions

File tree

package-lock.json

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@
247247
"@types/node": "^25.7.0",
248248
"@types/request": "^2.47.0",
249249
"@types/request-promise": "^4.1.41",
250-
"@types/sinon": "^17.0.2",
250+
"@types/sinon": "^21.0.1",
251251
"@types/sinon-chai": "^3.0.0",
252252
"@types/uuid": "^10.0.0",
253253
"@typescript-eslint/eslint-plugin": "^8.59.3",
@@ -276,7 +276,7 @@
276276
"request": "^2.75.0",
277277
"request-promise": "^4.1.1",
278278
"run-sequence": "^2.2.1",
279-
"sinon": "^18.0.0",
279+
"sinon": "^22.0.0",
280280
"sinon-chai": "^3.0.0",
281281
"ts-node": "^10.2.0",
282282
"typescript": "^5.7.3",

test/unit/utils/api-request.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,10 @@ describe('HttpClient', () => {
11011101
});
11021102

11031103
it('should wait when retry-after expressed as a timestamp', () => {
1104-
clock = sinon.useFakeTimers();
1104+
clock = sinon.useFakeTimers({
1105+
toFake: ['Date', 'setTimeout', 'clearTimeout', 'setInterval', 'clearInterval'],
1106+
shouldClearNativeTimers: true
1107+
});
11051108
clock.setSystemTime(1000);
11061109
const timestamp = new Date(clock.now + 30 * 1000);
11071110

test/unit/utils/jwt.spec.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,11 @@ describe('UrlKeyFetcher', () => {
599599
mockedRequests.push(mockFetchPublicKeys());
600600
mockedRequests.push(mockFetchPublicKeys());
601601

602-
clock = sinon.useFakeTimers(1000);
602+
clock = sinon.useFakeTimers({
603+
now: 1000,
604+
toFake: ['Date', 'setTimeout', 'clearTimeout', 'setInterval', 'clearInterval'],
605+
shouldClearNativeTimers: true
606+
});
603607

604608
return keyFetcher.fetchPublicKeys().then(() => {
605609
expect(https.request).to.have.been.calledOnce;
@@ -716,7 +720,11 @@ describe('JwksFetcher', () => {
716720
mockedRequests.push(mockFetchJsonWebKeys());
717721
mockedRequests.push(mockFetchJsonWebKeys());
718722

719-
clock = sinon.useFakeTimers(1000);
723+
clock = sinon.useFakeTimers({
724+
now: 1000,
725+
toFake: ['Date', 'setTimeout', 'clearTimeout', 'setInterval', 'clearInterval'],
726+
shouldClearNativeTimers: true
727+
});
720728

721729
return keyFetcher.fetchPublicKeys().then(() => {
722730
expect(https.request).to.have.been.calledOnce;

0 commit comments

Comments
 (0)