From 60f2422e2a25140468442b5277de615de0b6f7c6 Mon Sep 17 00:00:00 2001 From: Evan Hahn <69474926+EvanHahn-Signal@users.noreply.github.com> Date: Tue, 13 Oct 2020 17:21:42 -0500 Subject: [PATCH] Consolidate `sleep` usages into a tested utility function --- js/modules/debug.js | 2 +- js/modules/sleep.js | 3 - package.json | 4 +- ts/services/groupCredentialFetcher.ts | 5 +- ts/test/util/sleep_test.ts | 33 ++++ ts/util/batcher.ts | 6 +- ts/util/lint/exceptions.json | 244 ++++++++++++++++++++++++-- ts/util/sleep.ts | 5 + ts/util/waitBatcher.ts | 6 +- yarn.lock | 133 ++++++++------ 10 files changed, 357 insertions(+), 84 deletions(-) delete mode 100644 js/modules/sleep.js create mode 100644 ts/test/util/sleep_test.ts create mode 100644 ts/util/sleep.ts diff --git a/js/modules/debug.js b/js/modules/debug.js index f787fb9665..aa86c9ccd1 100644 --- a/js/modules/debug.js +++ b/js/modules/debug.js @@ -16,7 +16,7 @@ const { const Attachments = require('../../app/attachments'); const Message = require('./types/message'); -const { sleep } = require('./sleep'); +const { sleep } = require('../../ts/util/sleep'); // See: https://en.wikipedia.org/wiki/Fictitious_telephone_number#North_American_Numbering_Plan const SENDER_ID = '+12126647665'; diff --git a/js/modules/sleep.js b/js/modules/sleep.js deleted file mode 100644 index 3ace89d628..0000000000 --- a/js/modules/sleep.js +++ /dev/null @@ -1,3 +0,0 @@ -/* global setTimeout */ - -exports.sleep = ms => new Promise(resolve => setTimeout(resolve, ms)); diff --git a/package.json b/package.json index ed528bfde5..a186c7c3cd 100644 --- a/package.json +++ b/package.json @@ -192,7 +192,7 @@ "@types/rimraf": "2.0.2", "@types/semver": "5.5.0", "@types/sharp": "0.23.1", - "@types/sinon": "4.3.1", + "@types/sinon": "9.0.8", "@types/storybook__addon-actions": "3.4.3", "@types/storybook__addon-knobs": "5.0.3", "@types/storybook__react": "4.0.2", @@ -244,7 +244,7 @@ "prettier": "1.19.1", "react-docgen-typescript": "1.2.6", "sass-loader": "7.2.0", - "sinon": "4.4.2", + "sinon": "9.2.0", "snyk": "1.316.1", "spectron": "5.0.0", "style-loader": "1.0.0", diff --git a/ts/services/groupCredentialFetcher.ts b/ts/services/groupCredentialFetcher.ts index 2e913f6e1f..3e30e15802 100644 --- a/ts/services/groupCredentialFetcher.ts +++ b/ts/services/groupCredentialFetcher.ts @@ -8,6 +8,7 @@ import { } from '../util/zkgroup'; import { GroupCredentialType } from '../textsecure/WebAPI'; +import { sleep } from '../util/sleep'; export const GROUP_CREDENTIALS_KEY = 'groupCredentials'; @@ -30,10 +31,6 @@ function getTodayInEpoch() { return Math.floor(Date.now() / DAY); } -async function sleep(ms: number) { - return new Promise(resolve => setTimeout(resolve, ms)); -} - let started = false; export async function initializeGroupCredentialFetcher(): Promise { diff --git a/ts/test/util/sleep_test.ts b/ts/test/util/sleep_test.ts new file mode 100644 index 0000000000..a8eaa9cddd --- /dev/null +++ b/ts/test/util/sleep_test.ts @@ -0,0 +1,33 @@ +import { assert } from 'chai'; +import { useFakeTimers } from 'sinon'; + +import { sleep } from '../../util/sleep'; + +describe('sleep', () => { + beforeEach(function beforeEach() { + // This isn't a hook. + // eslint-disable-next-line react-hooks/rules-of-hooks + this.clock = useFakeTimers(); + }); + + afterEach(function afterEach() { + this.clock.restore(); + }); + + it('returns a promise that resolves after the specified number of milliseconds', async function test() { + let isDone = false; + + (async () => { + await sleep(123); + isDone = true; + })(); + + assert.isFalse(isDone); + + await this.clock.tickAsync(100); + assert.isFalse(isDone); + + await this.clock.tickAsync(25); + assert.isTrue(isDone); + }); +}); diff --git a/ts/util/batcher.ts b/ts/util/batcher.ts index cfb827ca67..e7ccca01d8 100644 --- a/ts/util/batcher.ts +++ b/ts/util/batcher.ts @@ -1,5 +1,7 @@ import PQueue from 'p-queue'; +import { sleep } from './sleep'; + declare global { interface Window { // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -28,10 +30,6 @@ export type BatcherType = { unregister: () => void; }; -async function sleep(ms: number): Promise { - await new Promise(resolve => setTimeout(resolve, ms)); -} - export function createBatcher( options: BatcherOptionsType ): BatcherType { diff --git a/ts/util/lint/exceptions.json b/ts/util/lint/exceptions.json index 80b2ee76ff..473ee30880 100644 --- a/ts/util/lint/exceptions.json +++ b/ts/util/lint/exceptions.json @@ -1429,21 +1429,243 @@ "updated": "2018-09-15T00:38:04.183Z" }, { - "rule": "DOM-innerHTML", - "path": "node_modules/@sinonjs/formatio/lib/formatio.js", - "line": " // SVG elements have undefined innerHTML", - "lineNumber": 204, - "reasonCategory": "falseMatch", - "updated": "2018-09-15T00:38:04.183Z" + "rule": "jQuery-wrap(", + "path": "node_modules/@sinonjs/commons/lib/deprecated.js", + "line": " * Returns a string which can be supplied to `wrap()` to notify the user that a", + "lineNumber": 24, + "reasonCategory": "testCode", + "updated": "2020-10-09T22:28:48.591Z", + "reasonDetail": "Test code. Also a false match." + }, + { + "rule": "jQuery-wrap(", + "path": "node_modules/@sinonjs/commons/lib/deprecated.test.js", + "line": " wrapped = deprecated.wrap(method, msg);", + "lineNumber": 66, + "reasonCategory": "testCode", + "updated": "2020-10-09T22:28:48.591Z", + "reasonDetail": "Test code. Also a false match." + }, + { + "rule": "jQuery-wrap(", + "path": "node_modules/@sinonjs/commons/lib/deprecated.test.js", + "line": " wrapped = deprecated.wrap(method, msg);", + "lineNumber": 80, + "reasonCategory": "testCode", + "updated": "2020-10-09T22:28:48.591Z", + "reasonDetail": "Test code. Also a false match." + }, + { + "rule": "jQuery-before(", + "path": "node_modules/@sinonjs/commons/lib/deprecated.test.js", + "line": " before(function() {", + "lineNumber": 86, + "reasonCategory": "testCode", + "updated": "2020-10-09T22:28:48.591Z", + "reasonDetail": "Test code. Also a false match." + }, + { + "rule": "eval", + "path": "node_modules/@sinonjs/commons/lib/function-name.test.js", + "line": " fn = eval(\"(function*() {})\")().constructor;", + "lineNumber": 67, + "reasonCategory": "testCode", + "updated": "2020-10-09T22:28:48.591Z" + }, + { + "rule": "jQuery-before(", + "path": "node_modules/@sinonjs/commons/lib/global.test.js", + "line": " before(function() {", + "lineNumber": 7, + "reasonCategory": "testCode", + "updated": "2020-10-09T22:28:48.591Z", + "reasonDetail": "Test code. Also a false match." + }, + { + "rule": "jQuery-wrap(", + "path": "node_modules/@sinonjs/fake-timers/fake-timers.js", + "line": "// defaultMsg returns a string which can be supplied to `wrap()` to notify the user that a particular part of the", + "lineNumber": 75, + "reasonCategory": "testCode", + "updated": "2020-10-09T22:28:48.591Z", + "reasonDetail": "Test code. Also a false match." + }, + { + "rule": "eval", + "path": "node_modules/@sinonjs/fake-timers/fake-timers.js", + "line": " eval(timer.func);", + "lineNumber": 1729, + "reasonCategory": "testCode", + "updated": "2020-10-09T22:28:48.591Z" + }, + { + "rule": "eval", + "path": "node_modules/@sinonjs/fake-timers/src/fake-timers-src.js", + "line": " eval(timer.func);", + "lineNumber": 425, + "reasonCategory": "testCode", + "updated": "2020-10-09T22:28:48.591Z" }, { "rule": "DOM-innerHTML", "path": "node_modules/@sinonjs/formatio/lib/formatio.js", - "line": " var content = element.innerHTML || \"\";", - "lineNumber": 205, - "reasonCategory": "usageTrusted", - "updated": "2020-09-11T17:24:56.124Z", - "reasonDetail": "Read, not write" + "line": " // SVG elements have undefined innerHTML", + "lineNumber": 253, + "reasonCategory": "testCode", + "updated": "2020-10-09T22:28:48.591Z", + "reasonDetail": "Test code. Also a false match." + }, + { + "rule": "DOM-innerHTML", + "path": "node_modules/@sinonjs/formatio/lib/formatio.js", + "line": " var content = element.innerHTML || \"\";", + "lineNumber": 254, + "reasonCategory": "testCode", + "updated": "2020-10-09T22:28:48.591Z" + }, + { + "rule": "jQuery-prepend(", + "path": "node_modules/@sinonjs/text-encoding/lib/encoding.js", + "line": " stream.prepend(bite);", + "lineNumber": 1439, + "reasonCategory": "testCode", + "updated": "2020-10-09T22:28:48.591Z", + "reasonDetail": "Test code. Also a false match." + }, + { + "rule": "jQuery-prepend(", + "path": "node_modules/@sinonjs/text-encoding/lib/encoding.js", + "line": " stream.prepend(buffer);", + "lineNumber": 1738, + "reasonCategory": "testCode", + "updated": "2020-10-09T22:28:48.591Z", + "reasonDetail": "Test code. Also a false match." + }, + { + "rule": "jQuery-prepend(", + "path": "node_modules/@sinonjs/text-encoding/lib/encoding.js", + "line": " stream.prepend([gb18030_second, bite]);", + "lineNumber": 1758, + "reasonCategory": "testCode", + "updated": "2020-10-09T22:28:48.591Z", + "reasonDetail": "Test code. Also a false match." + }, + { + "rule": "jQuery-prepend(", + "path": "node_modules/@sinonjs/text-encoding/lib/encoding.js", + "line": " stream.prepend(bite);", + "lineNumber": 1798, + "reasonCategory": "testCode", + "updated": "2020-10-09T22:28:48.591Z", + "reasonDetail": "Test code. Also a false match." + }, + { + "rule": "jQuery-prepend(", + "path": "node_modules/@sinonjs/text-encoding/lib/encoding.js", + "line": " stream.prepend(bite);", + "lineNumber": 2007, + "reasonCategory": "testCode", + "updated": "2020-10-09T22:28:48.591Z", + "reasonDetail": "Test code. Also a false match." + }, + { + "rule": "jQuery-prepend(", + "path": "node_modules/@sinonjs/text-encoding/lib/encoding.js", + "line": " stream.prepend(bite);", + "lineNumber": 2175, + "reasonCategory": "testCode", + "updated": "2020-10-09T22:28:48.591Z", + "reasonDetail": "Test code. Also a false match." + }, + { + "rule": "jQuery-prepend(", + "path": "node_modules/@sinonjs/text-encoding/lib/encoding.js", + "line": " stream.prepend(bite);", + "lineNumber": 2492, + "reasonCategory": "testCode", + "updated": "2020-10-09T22:28:48.591Z", + "reasonDetail": "Test code. Also a false match." + }, + { + "rule": "jQuery-prepend(", + "path": "node_modules/@sinonjs/text-encoding/lib/encoding.js", + "line": " stream.prepend(bite);", + "lineNumber": 2515, + "reasonCategory": "testCode", + "updated": "2020-10-09T22:28:48.591Z", + "reasonDetail": "Test code. Also a false match." + }, + { + "rule": "jQuery-prepend(", + "path": "node_modules/@sinonjs/text-encoding/lib/encoding.js", + "line": " stream.prepend([lead, bite]);", + "lineNumber": 2570, + "reasonCategory": "testCode", + "updated": "2020-10-09T22:28:48.591Z", + "reasonDetail": "Test code. Also a false match." + }, + { + "rule": "jQuery-prepend(", + "path": "node_modules/@sinonjs/text-encoding/lib/encoding.js", + "line": " stream.prepend(code_point);", + "lineNumber": 2612, + "reasonCategory": "testCode", + "updated": "2020-10-09T22:28:48.591Z", + "reasonDetail": "Test code. Also a false match." + }, + { + "rule": "jQuery-prepend(", + "path": "node_modules/@sinonjs/text-encoding/lib/encoding.js", + "line": " stream.prepend(code_point);", + "lineNumber": 2665, + "reasonCategory": "testCode", + "updated": "2020-10-09T22:28:48.591Z", + "reasonDetail": "Test code. Also a false match." + }, + { + "rule": "jQuery-prepend(", + "path": "node_modules/@sinonjs/text-encoding/lib/encoding.js", + "line": " stream.prepend(code_point);", + "lineNumber": 2676, + "reasonCategory": "testCode", + "updated": "2020-10-09T22:28:48.591Z", + "reasonDetail": "Test code. Also a false match." + }, + { + "rule": "jQuery-prepend(", + "path": "node_modules/@sinonjs/text-encoding/lib/encoding.js", + "line": " stream.prepend(code_point);", + "lineNumber": 2697, + "reasonCategory": "testCode", + "updated": "2020-10-09T22:28:48.591Z", + "reasonDetail": "Test code. Also a false match." + }, + { + "rule": "jQuery-prepend(", + "path": "node_modules/@sinonjs/text-encoding/lib/encoding.js", + "line": " stream.prepend(bite);", + "lineNumber": 2790, + "reasonCategory": "testCode", + "updated": "2020-10-09T22:28:48.591Z", + "reasonDetail": "Test code. Also a false match." + }, + { + "rule": "jQuery-prepend(", + "path": "node_modules/@sinonjs/text-encoding/lib/encoding.js", + "line": " stream.prepend(bite);", + "lineNumber": 2957, + "reasonCategory": "testCode", + "updated": "2020-10-09T22:28:48.591Z", + "reasonDetail": "Test code. Also a false match." + }, + { + "rule": "jQuery-prepend(", + "path": "node_modules/@sinonjs/text-encoding/lib/encoding.js", + "line": " stream.prepend(convertCodeUnitToBytes(code_unit, utf16_be));", + "lineNumber": 3139, + "reasonCategory": "testCode", + "updated": "2020-10-09T22:28:48.591Z", + "reasonDetail": "Test code. Also a false match." }, { "rule": "eval", diff --git a/ts/util/sleep.ts b/ts/util/sleep.ts new file mode 100644 index 0000000000..c51596d8ab --- /dev/null +++ b/ts/util/sleep.ts @@ -0,0 +1,5 @@ +export function sleep(ms: number): Promise { + return new Promise(resolve => { + setTimeout(resolve, ms); + }); +} diff --git a/ts/util/waitBatcher.ts b/ts/util/waitBatcher.ts index 7bec922866..e4028520f9 100644 --- a/ts/util/waitBatcher.ts +++ b/ts/util/waitBatcher.ts @@ -1,5 +1,7 @@ import PQueue from 'p-queue'; +import { sleep } from './sleep'; + declare global { interface Window { // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -39,10 +41,6 @@ type BatcherType = { unregister: () => void; }; -async function sleep(ms: number): Promise { - await new Promise(resolve => setTimeout(resolve, ms)); -} - export function createWaitBatcher( options: BatcherOptionsType ): BatcherType { diff --git a/yarn.lock b/yarn.lock index b879f5843b..bab9b0c6ae 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1403,11 +1403,41 @@ version "0.7.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.7.0.tgz#9a06f4f137ee84d7df0460c1fdb1135ffa6c50fd" -"@sinonjs/formatio@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@sinonjs/formatio/-/formatio-2.0.0.tgz#84db7e9eb5531df18a8c5e0bfb6e449e55e654b2" +"@sinonjs/commons@^1", "@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== dependencies: - samsam "1.3.0" + 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== + dependencies: + "@sinonjs/commons" "^1.7.0" + +"@sinonjs/formatio@^5.0.1": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@sinonjs/formatio/-/formatio-5.0.1.tgz#f13e713cb3313b1ab965901b01b0828ea6b77089" + integrity sha512-KaiQ5pBf1MpS09MuA0kp6KBQt2JUOQycqVG1NZXvzeaXe5LGFqAKueIS0bw4w0P9r7KuBSVdUk5QjXsUdu2CxQ== + dependencies: + "@sinonjs/commons" "^1" + "@sinonjs/samsam" "^5.0.2" + +"@sinonjs/samsam@^5.0.2", "@sinonjs/samsam@^5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@sinonjs/samsam/-/samsam-5.2.0.tgz#fcff83ab86f83b5498f4a967869c079408d9b5eb" + integrity sha512-CaIcyX5cDsjcW/ab7HposFWzV1kC++4HNsfnEdFJa7cP1QIuILAKV+BgfeqRXhcnSAc76r/Rh/O5C+300BwUIw== + dependencies: + "@sinonjs/commons" "^1.6.0" + lodash.get "^4.4.2" + type-detect "^4.0.8" + +"@sinonjs/text-encoding@^0.7.1": + version "0.7.1" + resolved "https://registry.yarnpkg.com/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz#8da5c6530915653f3a1f38fd5f101d8c3f8079c5" + integrity sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ== "@snyk/cli-interface@1.5.0": version "1.5.0" @@ -2500,10 +2530,17 @@ dependencies: "@types/node" "*" -"@types/sinon@4.3.1": - version "4.3.1" - resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-4.3.1.tgz#32458f9b166cd44c23844eee4937814276f35199" - integrity sha512-DK4YtH30I67k4klURIBS4VAe1aBISfS9lgNlHFkibSmKem2tLQc5VkKoJreT3dCJAd+xRyCS8bx1o97iq3yUVg== +"@types/sinon@9.0.8": + version "9.0.8" + resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-9.0.8.tgz#1ed0038d356784f75b086104ef83bfd4130bb81b" + integrity sha512-IVnI820FZFMGI+u1R+2VdRaD/82YIQTdqLYC9DLPszZuynAJDtCvCtCs3bmyL66s7FqRM3+LPX7DhHnVTaagDw== + dependencies: + "@types/sinonjs__fake-timers" "*" + +"@types/sinonjs__fake-timers@*": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-6.0.2.tgz#3a84cf5ec3249439015e14049bd3161419bf9eae" + integrity sha512-dIPoZ3g5gcx9zZEszaxLSVTvMReD3xxyyDnQUjA6IYDG9Ba2AV0otMPs+77sG9ojB4Qr2N2Vk5RnKeuA0X/0bg== "@types/sizzle@*": version "2.3.2" @@ -5935,15 +5972,16 @@ diff@3.5.0: version "3.5.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" -diff@^3.1.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.4.0.tgz#b1d85507daf3964828de54b37d0d73ba67dda56c" - diff@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.1.tgz#0c667cb467ebbb5cea7f14f135cc2dba7780a8ff" integrity sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q== +diff@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + diffie-hellman@^5.0.0: version "5.0.2" resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.2.tgz#b5835739270cfe26acf632099fded2a07f209e5e" @@ -9917,9 +9955,10 @@ jszip@^3.2.2: readable-stream "~2.3.6" set-immediate-shim "~1.0.1" -just-extend@^1.1.27: - version "1.1.27" - resolved "https://registry.yarnpkg.com/just-extend/-/just-extend-1.1.27.tgz#ec6e79410ff914e472652abfa0e603c03d60e905" +just-extend@^4.0.2: + version "4.1.1" + resolved "https://registry.yarnpkg.com/just-extend/-/just-extend-4.1.1.tgz#158f1fdb01f128c411dc8b286a7b4837b3545282" + integrity sha512-aWgeGFW67BP3e5181Ep1Fv2v8z//iBJfrvyTnq8wG86vEESwmonn1zPBJ0VfmT9CJq2FIT0VsETtrNFm2a+SHA== keyv@3.0.0: version "3.0.0" @@ -10272,10 +10311,6 @@ loglevel@^1.6.3: resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.3.tgz#77f2eb64be55a404c9fd04ad16d57c1d6d6b1280" integrity sha512-LoEDv5pgpvWgPF4kNYuIp0qqSJVWak/dML0RY74xlzMZiT9w77teNAwKYKWBTYjlokMirg+o3jBwp+vlLrcfAA== -lolex@^2.2.0, lolex@^2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/lolex/-/lolex-2.3.2.tgz#85f9450425103bf9e7a60668ea25dc43274ca807" - long@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" @@ -11115,15 +11150,16 @@ nice-try@^1.0.4: resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== -nise@^1.2.0: - version "1.2.6" - resolved "https://registry.yarnpkg.com/nise/-/nise-1.2.6.tgz#42b054981a5c869d6c447be5776cc6f137f00ac5" +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== dependencies: - "@sinonjs/formatio" "^2.0.0" - just-extend "^1.1.27" - lolex "^2.3.2" + "@sinonjs/commons" "^1.7.0" + "@sinonjs/fake-timers" "^6.0.0" + "@sinonjs/text-encoding" "^0.7.1" + just-extend "^4.0.2" path-to-regexp "^1.7.0" - text-encoding "^0.6.4" no-case@^2.2.0: version "2.3.2" @@ -14179,10 +14215,6 @@ safe-regex@^1.1.0: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -samsam@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/samsam/-/samsam-1.3.0.tgz#8d1d9350e25622da30de3e44ba692b5221ab7c50" - sanitize-filename@1.6.3, sanitize-filename@^1.6.3: version "1.6.3" resolved "https://registry.yarnpkg.com/sanitize-filename/-/sanitize-filename-1.6.3.tgz#755ebd752045931977e30b2025d340d7c9090378" @@ -14615,18 +14647,18 @@ single-line-log@^1.1.2: dependencies: string-width "^1.0.1" -sinon@4.4.2: - version "4.4.2" - resolved "https://registry.yarnpkg.com/sinon/-/sinon-4.4.2.tgz#c4c41d4bd346e1d33594daec2d5df0548334fc65" - integrity sha512-cpOHpnRyY3Dk9dTHBYMfVBB0HUCSKIpxW07X6OGW2NiYPovs4AkcL8Q8MzecbAROjbfRA9esJCmlZgikxDz7DA== +sinon@9.2.0: + version "9.2.0" + resolved "https://registry.yarnpkg.com/sinon/-/sinon-9.2.0.tgz#1d333967e30023609f7347351ebc0dc964c0f3c9" + integrity sha512-eSNXz1XMcGEMHw08NJXSyTHIu6qTCOiN8x9ODACmZpNQpr0aXTBXBnI4xTzQzR+TEpOmLiKowGf9flCuKIzsbw== dependencies: - "@sinonjs/formatio" "^2.0.0" - diff "^3.1.0" - lodash.get "^4.4.2" - lolex "^2.2.0" - nise "^1.2.0" - supports-color "^5.1.0" - type-detect "^4.0.5" + "@sinonjs/commons" "^1.8.1" + "@sinonjs/fake-timers" "^6.0.1" + "@sinonjs/formatio" "^5.0.1" + "@sinonjs/samsam" "^5.2.0" + diff "^4.0.2" + nise "^4.0.4" + supports-color "^7.1.0" slash@^1.0.0: version "1.0.0" @@ -15519,12 +15551,6 @@ supports-color@^3.1.2, supports-color@^3.2.3: dependencies: has-flag "^1.0.0" -supports-color@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.2.0.tgz#b0d5333b1184dd3666cbe5aa0b45c5ac7ac17a4a" - dependencies: - has-flag "^3.0.0" - supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" @@ -15782,10 +15808,6 @@ testcheck@1.0.0-rc.2, testcheck@^1.0.0-rc: resolved "https://registry.yarnpkg.com/testcheck/-/testcheck-1.0.0-rc.2.tgz#11356a25b84575efe0b0857451e85b5fa74ee4e4" integrity sha1-ETVqJbhFde/gsIV0UehbX6dO5OQ= -text-encoding@^0.6.4: - version "0.6.4" - resolved "https://registry.yarnpkg.com/text-encoding/-/text-encoding-0.6.4.tgz#e399a982257a276dae428bb92845cb71bdc26d19" - text-table@0.2.0, text-table@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" @@ -16130,14 +16152,15 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" +type-detect@4.0.8, type-detect@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" + integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== + type-detect@^4.0.0: version "4.0.5" resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.5.tgz#d70e5bc81db6de2a381bcaca0c6e0cbdc7635de2" -type-detect@^4.0.5: - version "4.0.8" - resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" - type-fest@^0.3.0: version "0.3.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.3.1.tgz#63d00d204e059474fe5e1b7c011112bbd1dc29e1"