From c27387aee41428f7e10a63420d10b58a4b3b0e24 Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Wed, 20 Sep 2023 16:06:53 -0600 Subject: [PATCH] feat: use sinon 16 --- package.json | 2 +- src/chai.ts | 2 -- src/stub.ts | 2 +- test/do.test.ts | 2 -- test/env.test.ts | 2 -- test/finally.test.ts | 2 -- test/retries.test.ts | 2 -- test/stdmock.test.ts | 2 -- test/stub.test.ts | 2 -- yarn.lock | 81 +++++++++++++++++++++++++++----------------- 10 files changed, 52 insertions(+), 47 deletions(-) diff --git a/package.json b/package.json index 3c5fd75..5393997 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "@types/lodash": "*", "@types/node": "*", "@types/sinon": "*", - "sinon": "^9.0.2", + "sinon": "^16.0.0", "lodash": "^4.17.13", "mock-stdin": "^1.0.0", "nock": "^13.3.3", diff --git a/src/chai.ts b/src/chai.ts index 31ff238..9d3f44c 100644 --- a/src/chai.ts +++ b/src/chai.ts @@ -1,5 +1,3 @@ -// tslint:disable no-unused - const tryRequire = (module: string) => { try { return require(module) diff --git a/src/stub.ts b/src/stub.ts index a557ac2..d4a8624 100644 --- a/src/stub.ts +++ b/src/stub.ts @@ -21,7 +21,7 @@ export default function , K extends keyof T> ( stub = fn(ctx.sandbox.stub(object, path)) }, finally() { - stub.restore() + stub?.restore() }, } } diff --git a/test/do.test.ts b/test/do.test.ts index 0a56758..064f2fb 100644 --- a/test/do.test.ts +++ b/test/do.test.ts @@ -1,5 +1,3 @@ -// tslint:disable no-console - import {expect, fancy} from '../src' describe('do', () => { diff --git a/test/env.test.ts b/test/env.test.ts index cd7981e..3b94c9d 100644 --- a/test/env.test.ts +++ b/test/env.test.ts @@ -1,5 +1,3 @@ -// tslint:disable no-console - import {expect, fancy} from '../src' process.env.PREDEFINED = '1' diff --git a/test/finally.test.ts b/test/finally.test.ts index f5fcff8..872ee9b 100644 --- a/test/finally.test.ts +++ b/test/finally.test.ts @@ -1,5 +1,3 @@ -// tslint:disable no-console - import {fancy} from '../src' describe('finally', () => { diff --git a/test/retries.test.ts b/test/retries.test.ts index f43d416..4f48cbb 100644 --- a/test/retries.test.ts +++ b/test/retries.test.ts @@ -1,5 +1,3 @@ -// tslint:disable no-console - import {fancy} from '../src' let count = 3 diff --git a/test/stdmock.test.ts b/test/stdmock.test.ts index 1b89a73..88fd8ed 100644 --- a/test/stdmock.test.ts +++ b/test/stdmock.test.ts @@ -1,5 +1,3 @@ -// tslint:disable no-console - import * as chalk from 'chalk' import {expect, fancy} from '../src' diff --git a/test/stub.test.ts b/test/stub.test.ts index 16f0ba7..e73dc3c 100644 --- a/test/stub.test.ts +++ b/test/stub.test.ts @@ -1,5 +1,3 @@ -// tslint:disable no-console - import {expect, fancy} from '../src' const os = require('node:os') diff --git a/yarn.lock b/yarn.lock index 47209ad..d4f69ae 100644 --- a/yarn.lock +++ b/yarn.lock @@ -126,26 +126,33 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@sinonjs/commons@^1.6.0", "@sinonjs/commons@^1.7.0", "@sinonjs/commons@^1.8.1": - version "1.8.1" - resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.1.tgz#e7df00f98a203324f6dc7cc606cad9d4a8ab2217" - integrity sha512-892K+kWUUi3cl+LlqEWIDrhvLgdL79tECi8JZUyq6IviKy/DNhuzCRlbHUjxK89f4ypPMMaFnFuR9Ie6DoIMsw== +"@sinonjs/commons@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-2.0.0.tgz#fd4ca5b063554307e8327b4564bd56d3b73924a3" + integrity sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg== dependencies: type-detect "4.0.8" -"@sinonjs/fake-timers@^6.0.0", "@sinonjs/fake-timers@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz#293674fccb3262ac782c7aadfdeca86b10c75c40" - integrity sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA== +"@sinonjs/commons@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-3.0.0.tgz#beb434fe875d965265e04722ccfc21df7f755d72" + integrity sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA== dependencies: - "@sinonjs/commons" "^1.7.0" + type-detect "4.0.8" -"@sinonjs/samsam@^5.3.1": - version "5.3.1" - resolved "https://registry.yarnpkg.com/@sinonjs/samsam/-/samsam-5.3.1.tgz#375a45fe6ed4e92fca2fb920e007c48232a6507f" - integrity sha512-1Hc0b1TtyfBu8ixF/tpfSHTVWKwCBLY4QJbkgnE7HcwyvT2xArDxb4K7dMgqRm3szI+LJbzmW/s4xxEhv6hwDg== +"@sinonjs/fake-timers@^10.0.2", "@sinonjs/fake-timers@^10.3.0": + version "10.3.0" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz#55fdff1ecab9f354019129daf4df0dd4d923ea66" + integrity sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA== + dependencies: + "@sinonjs/commons" "^3.0.0" + +"@sinonjs/samsam@^8.0.0": + version "8.0.0" + resolved "https://registry.yarnpkg.com/@sinonjs/samsam/-/samsam-8.0.0.tgz#0d488c91efb3fa1442e26abea81759dfc8b5ac60" + integrity sha512-Bp8KUVlLp8ibJZrnvq2foVhP0IVX2CIprMJPK0vqGqgrDa0OHVKeZyBykqskkrdxV6yKBPmGasO8LVjAKR3Gew== dependencies: - "@sinonjs/commons" "^1.6.0" + "@sinonjs/commons" "^2.0.0" lodash.get "^4.4.2" type-detect "^4.0.8" @@ -769,11 +776,16 @@ diff@5.0.0: resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== -diff@^4.0.1, diff@^4.0.2: +diff@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== +diff@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-5.1.0.tgz#bc52d298c5ea8df9194800224445ed43ffc87e40" + integrity sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw== + dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -2124,13 +2136,13 @@ natural-compare@^1.4.0: resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= -nise@^4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/nise/-/nise-4.0.4.tgz#d73dea3e5731e6561992b8f570be9e363c4512dd" - integrity sha512-bTTRUNlemx6deJa+ZyoCUTRvH3liK5+N6VQZ4NIw90AgDXY6iPnsqplNFf6STcj+ePk0H/xqxnP75Lr0J0Fq3A== +nise@^5.1.4: + version "5.1.4" + resolved "https://registry.yarnpkg.com/nise/-/nise-5.1.4.tgz#491ce7e7307d4ec546f5a659b2efe94a18b4bbc0" + integrity sha512-8+Ib8rRJ4L0o3kfmyVCL7gzrohyDe0cMFTBa2d364yIrEGMEoetznKJx899YxjybU6bL9SQkYPSBBs1gyYs8Xg== dependencies: - "@sinonjs/commons" "^1.7.0" - "@sinonjs/fake-timers" "^6.0.0" + "@sinonjs/commons" "^2.0.0" + "@sinonjs/fake-timers" "^10.0.2" "@sinonjs/text-encoding" "^0.7.1" just-extend "^4.0.2" path-to-regexp "^1.7.0" @@ -2619,17 +2631,17 @@ side-channel@^1.0.4: get-intrinsic "^1.0.2" object-inspect "^1.9.0" -sinon@^9.0.2: - version "9.2.4" - resolved "https://registry.yarnpkg.com/sinon/-/sinon-9.2.4.tgz#e55af4d3b174a4443a8762fa8421c2976683752b" - integrity sha512-zljcULZQsJxVra28qIAL6ow1Z9tpattkCTEJR4RBP3TGc00FcttsP5pK284Nas5WjMZU5Yzy3kAIp3B3KRf5Yg== +sinon@^16.0.0: + version "16.0.0" + resolved "https://registry.yarnpkg.com/sinon/-/sinon-16.0.0.tgz#06da4e63624b946c9d7e67cce21c2f67f40f23a9" + integrity sha512-B8AaZZm9CT5pqe4l4uWJztfD/mOTa7dL8Qo0W4+s+t74xECOgSZDDQCBjNgIK3+n4kyxQrSTv2V5ul8K25qkiQ== dependencies: - "@sinonjs/commons" "^1.8.1" - "@sinonjs/fake-timers" "^6.0.1" - "@sinonjs/samsam" "^5.3.1" - diff "^4.0.2" - nise "^4.0.4" - supports-color "^7.1.0" + "@sinonjs/commons" "^3.0.0" + "@sinonjs/fake-timers" "^10.3.0" + "@sinonjs/samsam" "^8.0.0" + diff "^5.1.0" + nise "^5.1.4" + supports-color "^7.2.0" slash@^3.0.0: version "3.0.0" @@ -2780,6 +2792,13 @@ supports-color@^7.1.0: dependencies: has-flag "^4.0.0" +supports-color@^7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + supports-preserve-symlinks-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09"