Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sinon related packages #43952

Merged
merged 3 commits into from
Sep 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@
"@types/rimraf": "^2.0.2",
"@types/selenium-webdriver": "^3.0.16",
"@types/semver": "^5.5.0",
"@types/sinon": "^7.0.0",
"@types/sinon": "^7.0.13",
"@types/strip-ansi": "^3.0.0",
"@types/styled-components": "^3.0.2",
"@types/supertest": "^2.0.5",
Expand Down Expand Up @@ -433,7 +433,7 @@
"sass-lint": "^1.12.1",
"selenium-webdriver": "^4.0.0-alpha.4",
"simple-git": "1.116.0",
"sinon": "^7.2.2",
"sinon": "^7.4.2",
"strip-ansi": "^3.0.1",
"supertest": "^3.1.0",
"supertest-as-promised": "^4.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-ui-framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"redux-thunk": "2.2.0",
"regenerator-runtime": "^0.13.3",
"sass-loader": "^7.3.1",
"sinon": "^7.2.2",
"sinon": "^7.4.2",
"style-loader": "^0.23.1",
"webpack": "^4.39.2",
"webpack-dev-server": "^3.8.0",
Expand Down
10 changes: 5 additions & 5 deletions x-pack/legacy/plugins/task_manager/lib/fill_pool.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('fillPool', () => {
const tasks = [[1, 2, 3], [4, 5]];
let index = 0;
const fetchAvailableTasks = async () => tasks[index++] || [];
const run = sinon.spy(() => true);
const run = sinon.spy(async () => true);
const converter = _.identity;

await fillPool(run, fetchAvailableTasks, converter);
Expand All @@ -25,7 +25,7 @@ describe('fillPool', () => {
const tasks = [[1, 2, 3], [4, 5]];
let index = 0;
const fetchAvailableTasks = async () => tasks[index++] || [];
const run = sinon.spy(() => false);
const run = sinon.spy(async () => false);
const converter = _.identity;

await fillPool(run, fetchAvailableTasks, converter);
Expand All @@ -37,7 +37,7 @@ describe('fillPool', () => {
const tasks = [[1, 2, 3], [4, 5]];
let index = 0;
const fetchAvailableTasks = async () => tasks[index++] || [];
const run = sinon.spy(() => false);
const run = sinon.spy(async () => false);
const converter = (x: number) => x.toString();

await fillPool(run, fetchAvailableTasks, converter);
Expand All @@ -47,7 +47,7 @@ describe('fillPool', () => {

describe('error handling', () => {
test('throws exception from fetchAvailableTasks', async () => {
const run = sinon.spy(() => false);
const run = sinon.spy(async () => false);
const converter = (x: number) => x.toString();

try {
Expand Down Expand Up @@ -80,7 +80,7 @@ describe('fillPool', () => {
const tasks = [[1, 2, 3], [4, 5]];
let index = 0;
const fetchAvailableTasks = async () => tasks[index++] || [];
const run = sinon.spy(() => false);
const run = sinon.spy(async () => false);
const converter = (x: number) => {
throw new Error(`can not convert ${x}`);
};
Expand Down
7 changes: 6 additions & 1 deletion x-pack/legacy/plugins/task_manager/task_pool.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,13 @@ describe('TaskPool', () => {
const firstRun = sinon.spy(async () => {
await sleep(0);
firstWork.resolve();
return { state: {} };
});
const secondWork = resolvable();
const secondRun = sinon.spy(async () => {
await sleep(0);
secondWork.resolve();
return { state: {} };
});

const result = await pool.run([
Expand Down Expand Up @@ -192,7 +194,10 @@ describe('TaskPool', () => {
});

function mockRun() {
return sinon.spy(async () => sleep(0));
return sinon.spy(async () => {
await sleep(0);
return { state: {} };
});
}

function mockTask() {
Expand Down
6 changes: 3 additions & 3 deletions x-pack/legacy/plugins/task_manager/task_store.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ describe('TaskStore', () => {

describe('fetch', () => {
async function testFetch(opts?: FetchOpts, hits: any[] = []) {
const callCluster = sinon.spy(async () => ({ hits: { hits } }));
const callCluster = sinon.spy(async (name: string, params?: any) => ({ hits: { hits } }));
const store = new TaskStore({
index: 'tasky',
serializer,
Expand Down Expand Up @@ -328,7 +328,7 @@ describe('TaskStore', () => {

describe('fetchAvailableTasks', () => {
async function testFetchAvailableTasks({ opts = {}, hits = [] }: any = {}) {
const callCluster = sinon.spy(async () => ({ hits: { hits } }));
const callCluster = sinon.spy(async (name: string, params?: any) => ({ hits: { hits } }));
const store = new TaskStore({
callCluster,
logger: mockLogger(),
Expand All @@ -350,7 +350,7 @@ describe('TaskStore', () => {
}

test('it returns normally with no tasks when the index does not exist.', async () => {
const callCluster = sinon.spy(async () => ({ hits: { hits: [] } }));
const callCluster = sinon.spy(async (name: string, params?: any) => ({ hits: { hits: [] } }));
const store = new TaskStore({
index: 'tasky',
serializer,
Expand Down
4 changes: 2 additions & 2 deletions x-pack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"@types/reduce-reducers": "^0.3.0",
"@types/redux-actions": "^2.2.1",
"@types/rimraf": "^2.0.2",
"@types/sinon": "^7.0.0",
"@types/sinon": "^7.0.13",
"@types/storybook__addon-actions": "^3.4.3",
"@types/storybook__addon-info": "^4.1.2",
"@types/storybook__addon-knobs": "^5.0.3",
Expand Down Expand Up @@ -166,7 +166,7 @@
"sass-loader": "^7.3.1",
"sass-resources-loader": "^2.0.1",
"simple-git": "1.116.0",
"sinon": "^7.2.2",
"sinon": "^7.4.2",
"string-replace-loader": "^2.2.0",
"supertest": "^3.1.0",
"supertest-as-promised": "^4.0.2",
Expand Down
94 changes: 45 additions & 49 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2303,28 +2303,34 @@
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.7.0.tgz#9a06f4f137ee84d7df0460c1fdb1135ffa6c50fd"
integrity sha512-ONhaKPIufzzrlNbqtWFFd+jlnemX6lJAgq9ZeiZtS7I1PIf/la7CW4m83rTXRnVnsMbW2k56pGYu7AUFJD9Pow==

"@sinonjs/commons@^1.0.2", "@sinonjs/commons@^1.2.0":
version "1.3.0"
resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.3.0.tgz#50a2754016b6f30a994ceda6d9a0a8c36adda849"
integrity sha512-j4ZwhaHmwsCb4DlDOIWnI5YyKDNMoNThsmwEpfHx6a1EpsGZ9qYLxP++LMlmBRjtGptGHFsGItJ768snllFWpA==
"@sinonjs/commons@^1", "@sinonjs/commons@^1.3.0", "@sinonjs/commons@^1.4.0":
version "1.6.0"
resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.6.0.tgz#ec7670432ae9c8eb710400d112c201a362d83393"
integrity sha512-w4/WHG7C4WWFyE5geCieFJF6MZkbW4VAriol5KlmQXpAQdxvV0p26sqNZOW6Qyw6Y0l9K4g+cHvvczR2sEEpqg==
dependencies:
type-detect "4.0.8"

"@sinonjs/formatio@^3.1.0":
version "3.1.0"
resolved "https://registry.yarnpkg.com/@sinonjs/formatio/-/formatio-3.1.0.tgz#6ac9d1eb1821984d84c4996726e45d1646d8cce5"
integrity sha512-ZAR2bPHOl4Xg6eklUGpsdiIJ4+J1SNag1DHHrG/73Uz/nVwXqjgUtRPLoS+aVyieN9cSbc0E4LsU984tWcDyNg==
"@sinonjs/formatio@^3.2.1":
version "3.2.1"
resolved "https://registry.yarnpkg.com/@sinonjs/formatio/-/formatio-3.2.1.tgz#52310f2f9bcbc67bdac18c94ad4901b95fde267e"
integrity sha512-tsHvOB24rvyvV2+zKMmPkZ7dXX6LSLKZ7aOtXY6Edklp0uRcgGpOsQTTGTcWViFyx4uhWc6GV8QdnALbIbIdeQ==
dependencies:
"@sinonjs/samsam" "^2 || ^3"
"@sinonjs/commons" "^1"
"@sinonjs/samsam" "^3.1.0"

"@sinonjs/samsam@^2 || ^3", "@sinonjs/samsam@^3.0.2":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@sinonjs/samsam/-/samsam-3.0.2.tgz#304fb33bd5585a0b2df8a4c801fcb47fa84d8e43"
integrity sha512-m08g4CS3J6lwRQk1pj1EO+KEVWbrbXsmi9Pw0ySmrIbcVxVaedoFgLvFsV8wHLwh01EpROVz3KvVcD1Jmks9FQ==
"@sinonjs/samsam@^3.1.0", "@sinonjs/samsam@^3.3.3":
version "3.3.3"
resolved "https://registry.yarnpkg.com/@sinonjs/samsam/-/samsam-3.3.3.tgz#46682efd9967b259b81136b9f120fd54585feb4a"
integrity sha512-bKCMKZvWIjYD0BLGnNrxVuw4dkWCYsLqFOUWw8VgKF/+5Y+mE7LfHWPIYoDXowH+3a9LsWDMo0uAP8YDosPvHQ==
dependencies:
"@sinonjs/commons" "^1.0.2"
"@sinonjs/commons" "^1.3.0"
array-from "^2.1.1"
lodash.get "^4.4.2"
lodash "^4.17.15"

"@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==

"@slack/client@^4.8.0":
version "4.8.0"
Expand Down Expand Up @@ -3896,10 +3902,10 @@
dependencies:
"@types/node" "*"

"@types/sinon@^7.0.0":
version "7.0.3"
resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-7.0.3.tgz#f8647e883d873962130f906a6114a4e187755696"
integrity sha512-cjmJQLx2B5Hp9SzO7rdSivipo3kBqRqeYkTW17nLST1tn5YLWBjTdnzdmeTJXA1+KrrBLsEuvKQ0fUPGrfazQg==
"@types/sinon@^7.0.13":
version "7.0.13"
resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-7.0.13.tgz#ca039c23a9e27ebea53e0901ef928ea2a1a6d313"
integrity sha512-d7c/C/+H/knZ3L8/cxhicHUiTDxdgap0b/aNJfsmLwFu/iOP17mdgbQsbHA3SJmrzsjD0l3UEE5SN4xxuz5ung==

"@types/stack-utils@^1.0.1":
version "1.0.1"
Expand Down Expand Up @@ -18506,15 +18512,10 @@ loglevelnext@^1.0.1:
es6-symbol "^3.1.1"
object.assign "^4.1.0"

lolex@^2.3.2:
version "2.6.0"
resolved "https://registry.yarnpkg.com/lolex/-/lolex-2.6.0.tgz#cf9166f3c9dece3cdeb5d6b01fce50f14a1203e3"
integrity sha512-e1UtIo1pbrIqEXib/yMjHciyqkng5lc0rrIbytgjmRgDR9+2ceNIAcwOWSgylRjoEP9VdVguCSRwnNmlbnOUwA==

lolex@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/lolex/-/lolex-3.0.0.tgz#f04ee1a8aa13f60f1abd7b0e8f4213ec72ec193e"
integrity sha512-hcnW80h3j2lbUfFdMArd5UPA/vxZJ+G8vobd+wg3nVEQA0EigStbYcrG030FJxL6xiDDPEkoMatV9xIh5OecQQ==
lolex@^4.1.0, lolex@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/lolex/-/lolex-4.2.0.tgz#ddbd7f6213ca1ea5826901ab1222b65d714b3cd7"
integrity sha512-gKO5uExCXvSm6zbF562EvM+rd1kQDnB9AZBbiQVzf1ZmdDpxUSvpnAaVOP83N/31mRK8Ml8/VE8DMvsAZQ+7wg==

long@^2.4.0:
version "2.4.0"
Expand Down Expand Up @@ -19857,16 +19858,16 @@ nigel@3.x.x:
hoek "5.x.x"
vise "3.x.x"

nise@^1.4.7:
version "1.4.8"
resolved "https://registry.yarnpkg.com/nise/-/nise-1.4.8.tgz#ce91c31e86cf9b2c4cac49d7fcd7f56779bfd6b0"
integrity sha512-kGASVhuL4tlAV0tvA34yJYZIVihrUt/5bDwpp4tTluigxUr2bBlJeDXmivb6NuEdFkqvdv/Ybb9dm16PSKUhtw==
nise@^1.5.2:
version "1.5.2"
resolved "https://registry.yarnpkg.com/nise/-/nise-1.5.2.tgz#b6d29af10e48b321b307e10e065199338eeb2652"
integrity sha512-/6RhOUlicRCbE9s+94qCUsyE+pKlVJ5AhIv+jEE7ESKwnbXqulKZ1FYU+XAtHHWE9TinYvAxDUJAb912PwPoWA==
dependencies:
"@sinonjs/formatio" "^3.1.0"
"@sinonjs/formatio" "^3.2.1"
"@sinonjs/text-encoding" "^0.7.1"
just-extend "^4.0.2"
lolex "^2.3.2"
lolex "^4.1.0"
path-to-regexp "^1.7.0"
text-encoding "^0.6.4"

no-case@^2.2.0, no-case@^2.3.2:
version "2.3.2"
Expand Down Expand Up @@ -25440,17 +25441,17 @@ simplify-js@^1.2.1:
resolved "https://registry.yarnpkg.com/simplify-js/-/simplify-js-1.2.3.tgz#a3422c1b9884d60421345eb44d2b872662df27f5"
integrity sha512-0IkEqs+5c5vROkHaifGfbqHf5tYDcsTBy6oJPRbFCSwp2uzEr+PpH3dNP7wD8O3d7zdUCjLVq1/xHkwA/JjlFA==

sinon@^7.2.2:
version "7.2.2"
resolved "https://registry.yarnpkg.com/sinon/-/sinon-7.2.2.tgz#388ecabd42fa93c592bfc71d35a70894d5a0ca07"
integrity sha512-WLagdMHiEsrRmee3jr6IIDntOF4kbI6N2pfbi8wkv50qaUQcBglkzkjtoOEbeJ2vf1EsrHhLI+5Ny8//WHdMoA==
sinon@^7.4.2:
version "7.4.2"
resolved "https://registry.yarnpkg.com/sinon/-/sinon-7.4.2.tgz#ecd54158fef2fcfbdb231a3fa55140e8cb02ad6c"
integrity sha512-pY5RY99DKelU3pjNxcWo6XqeB1S118GBcVIIdDi6V+h6hevn1izcg2xv1hTHW/sViRXU7sUOxt4wTUJ3gsW2CQ==
dependencies:
"@sinonjs/commons" "^1.2.0"
"@sinonjs/formatio" "^3.1.0"
"@sinonjs/samsam" "^3.0.2"
"@sinonjs/commons" "^1.4.0"
"@sinonjs/formatio" "^3.2.1"
"@sinonjs/samsam" "^3.3.3"
diff "^3.5.0"
lolex "^3.0.0"
nise "^1.4.7"
lolex "^4.2.0"
nise "^1.5.2"
supports-color "^5.5.0"

sisteransi@^1.0.0:
Expand Down Expand Up @@ -26916,11 +26917,6 @@ test-exclude@^5.2.3:
read-pkg-up "^4.0.0"
require-main-filename "^2.0.0"

text-encoding@^0.6.4:
version "0.6.4"
resolved "https://registry.yarnpkg.com/text-encoding/-/text-encoding-0.6.4.tgz#e399a982257a276dae428bb92845cb71bdc26d19"
integrity sha1-45mpgiV6J22uQou5KEXLcb3CbRk=

text-hex@1.0.x:
version "1.0.0"
resolved "https://registry.yarnpkg.com/text-hex/-/text-hex-1.0.0.tgz#69dc9c1b17446ee79a92bf5b884bb4b9127506f5"
Expand Down