mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[yarn] remove jest-when which introduced surprise native module deps (#128027)
This commit is contained in:
parent
01965aa5e7
commit
583de26396
4 changed files with 22 additions and 64 deletions
|
@ -572,7 +572,6 @@
|
|||
"@types/intl-relativeformat": "^2.1.0",
|
||||
"@types/jest": "^26.0.22",
|
||||
"@types/jest-specific-snapshot": "^0.5.5",
|
||||
"@types/jest-when": "^2.7.2",
|
||||
"@types/joi": "^17.2.3",
|
||||
"@types/jquery": "^3.3.31",
|
||||
"@types/js-levenshtein": "^1.1.0",
|
||||
|
@ -833,7 +832,6 @@
|
|||
"jest-snapshot": "^26.6.2",
|
||||
"jest-specific-snapshot": "2.0.0",
|
||||
"jest-styled-components": "^7.0.3",
|
||||
"jest-when": "^3.2.1",
|
||||
"jimp": "^0.14.0",
|
||||
"jsdom": "13.1.0",
|
||||
"json5": "^1.0.1",
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
*/
|
||||
|
||||
import fs from 'fs';
|
||||
import { when } from 'jest-when';
|
||||
import { SHAREABLE_RUNTIME_FILE } from '../../../shareable_runtime/constants';
|
||||
|
||||
import { kibanaResponseFactory, RequestHandlerContext, RequestHandler } from 'src/core/server';
|
||||
|
@ -33,8 +32,15 @@ describe('Download Canvas shareables runtime', () => {
|
|||
|
||||
it(`returns 200 with canvas shareables runtime`, async () => {
|
||||
const content = 'Canvas shareable runtime';
|
||||
const spy = jest.spyOn(fs, 'readFileSync').mockImplementation();
|
||||
when(spy).calledWith(SHAREABLE_RUNTIME_FILE).mockReturnValue(content);
|
||||
|
||||
jest.spyOn(fs, 'readFileSync').mockImplementation((p) => {
|
||||
switch (p) {
|
||||
case SHAREABLE_RUNTIME_FILE:
|
||||
return content;
|
||||
default:
|
||||
throw new Error(`unexpected argument to fs.readFileSync: ${p}`);
|
||||
}
|
||||
});
|
||||
|
||||
const request = httpServerMock.createKibanaRequest({
|
||||
method: 'get',
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
*/
|
||||
|
||||
import fs from 'fs';
|
||||
import { when } from 'jest-when';
|
||||
import { configSchema, createConfig } from './config';
|
||||
|
||||
const MOCKED_PATHS = [
|
||||
|
@ -17,10 +16,13 @@ const MOCKED_PATHS = [
|
|||
];
|
||||
|
||||
beforeEach(() => {
|
||||
const spy = jest.spyOn(fs, 'readFileSync').mockImplementation();
|
||||
MOCKED_PATHS.forEach((file) =>
|
||||
when(spy).calledWith(file, 'utf8').mockReturnValue(`contents-of-${file}`)
|
||||
);
|
||||
jest.spyOn(fs, 'readFileSync').mockImplementation((path, enc) => {
|
||||
if (typeof path === 'string' && MOCKED_PATHS.includes(path) && enc === 'utf8') {
|
||||
return `contents-of-${path}`;
|
||||
}
|
||||
|
||||
throw new Error(`unpexpected arguments to fs.readFileSync: ${path}, ${enc}`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('config schema', () => {
|
||||
|
|
60
yarn.lock
60
yarn.lock
|
@ -5833,13 +5833,6 @@
|
|||
dependencies:
|
||||
"@types/jest" "*"
|
||||
|
||||
"@types/jest-when@^2.7.2":
|
||||
version "2.7.2"
|
||||
resolved "https://registry.yarnpkg.com/@types/jest-when/-/jest-when-2.7.2.tgz#619fbc5f623bcd0b29efde0e4993c7f0d50d026d"
|
||||
integrity sha512-vOtj0cev6vO1VX7Jbfg/qvy+sfLI64STsHbKVkggK+1kd11rcMGzFpZKBxUvQfsm4JRULCBISu+qrfs7fYZFGg==
|
||||
dependencies:
|
||||
"@types/jest" "*"
|
||||
|
||||
"@types/jest@*", "@types/jest@^26.0.16", "@types/jest@^26.0.22":
|
||||
version "26.0.22"
|
||||
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.22.tgz#8308a1debdf1b807aa47be2838acdcd91e88fbe6"
|
||||
|
@ -9434,16 +9427,6 @@ builtin-status-codes@^3.0.0:
|
|||
resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8"
|
||||
integrity sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=
|
||||
|
||||
bunyan@^1.8.12:
|
||||
version "1.8.14"
|
||||
resolved "https://registry.yarnpkg.com/bunyan/-/bunyan-1.8.14.tgz#3d8c1afea7de158a5238c7cb8a66ab6b38dd45b4"
|
||||
integrity sha512-LlahJUxXzZLuw/hetUQJmRgZ1LF6+cr5TPpRj6jf327AsiIq2jhYEH4oqUUkVKTor+9w2BT3oxVwhzE5lw9tcg==
|
||||
optionalDependencies:
|
||||
dtrace-provider "~0.8"
|
||||
moment "^2.19.3"
|
||||
mv "~2"
|
||||
safe-json-stringify "~1"
|
||||
|
||||
bytes@3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048"
|
||||
|
@ -12713,13 +12696,6 @@ dpdm@3.5.0:
|
|||
typescript "^3.5.3"
|
||||
yargs "^13.3.0"
|
||||
|
||||
dtrace-provider@~0.8:
|
||||
version "0.8.8"
|
||||
resolved "https://registry.yarnpkg.com/dtrace-provider/-/dtrace-provider-0.8.8.tgz#2996d5490c37e1347be263b423ed7b297fb0d97e"
|
||||
integrity sha512-b7Z7cNtHPhH9EJhNNbbeqTcXB8LGFFZhq1PGgEvpeHlzd36bhbdTWoE/Ba/YguqpBSlAPKnARWhVlhunCMwfxg==
|
||||
dependencies:
|
||||
nan "^2.14.0"
|
||||
|
||||
duplexer2@^0.1.2, duplexer2@~0.1.0, duplexer2@~0.1.2, duplexer2@~0.1.4:
|
||||
version "0.1.4"
|
||||
resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1"
|
||||
|
@ -13916,7 +13892,7 @@ expand-tilde@^2.0.0, expand-tilde@^2.0.2:
|
|||
dependencies:
|
||||
homedir-polyfill "^1.0.1"
|
||||
|
||||
expect@^24.8.0, expect@^24.9.0:
|
||||
expect@^24.9.0:
|
||||
version "24.9.0"
|
||||
resolved "https://registry.yarnpkg.com/expect/-/expect-24.9.0.tgz#b75165b4817074fa4a157794f46fe9f1ba15b6ca"
|
||||
integrity sha512-wvVAx8XIol3Z5m9zvZXiyZOQ+sRJqNTIm6sGjdWlaZIeupQGO3WbYI+15D/AmEwZywL6wtJkbAbJtzkOfBuR0Q==
|
||||
|
@ -15209,7 +15185,7 @@ glob@7.2.0, glob@^7.0.0, glob@^7.0.3, glob@^7.1.0, glob@^7.1.1, glob@^7.1.2, glo
|
|||
once "^1.3.0"
|
||||
path-is-absolute "^1.0.0"
|
||||
|
||||
glob@^6.0.1, glob@^6.0.4:
|
||||
glob@^6.0.4:
|
||||
version "6.0.4"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22"
|
||||
integrity sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=
|
||||
|
@ -18174,14 +18150,6 @@ jest-watcher@^26.6.2:
|
|||
jest-util "^26.6.2"
|
||||
string-length "^4.0.1"
|
||||
|
||||
jest-when@^3.2.1:
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/jest-when/-/jest-when-3.2.1.tgz#69b58ff641a399a0f2db5bfee6d8dd40cd065eb8"
|
||||
integrity sha512-7OuFR5f2AdDPoRs/uk99dEWI+Isc2SFThugPjVUZgLLhWqeGr64rCFuuYcxVXQKwBmF3GG/MCS6zcKR9H86qiw==
|
||||
dependencies:
|
||||
bunyan "^1.8.12"
|
||||
expect "^24.8.0"
|
||||
|
||||
jest-worker@^26.5.0, jest-worker@^26.6.2:
|
||||
version "26.6.2"
|
||||
resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.6.2.tgz#7f72cbc4d643c365e27b9fd775f9d0eaa9c7a8ed"
|
||||
|
@ -20354,7 +20322,7 @@ moment-timezone@^0.5.27:
|
|||
dependencies:
|
||||
moment ">= 2.9.0"
|
||||
|
||||
"moment@>= 2.9.0", moment@>=1.6.0, moment@>=2.14.0, moment@^2.10.6, moment@^2.19.3, moment@^2.24.0:
|
||||
"moment@>= 2.9.0", moment@>=1.6.0, moment@>=2.14.0, moment@^2.10.6, moment@^2.24.0:
|
||||
version "2.28.0"
|
||||
resolved "https://registry.yarnpkg.com/moment/-/moment-2.28.0.tgz#cdfe73ce01327cee6537b0fafac2e0f21a237d75"
|
||||
integrity sha512-Z5KOjYmnHyd/ukynmFd/WwyXHd7L4J9vTI/nn5Ap9AVUgaAE15VvQ9MOGmJJygEUklupqIrFnor/tjTwRU+tQw==
|
||||
|
@ -20502,15 +20470,6 @@ mute-stream@0.0.8:
|
|||
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d"
|
||||
integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==
|
||||
|
||||
mv@~2:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/mv/-/mv-2.1.1.tgz#ae6ce0d6f6d5e0a4f7d893798d03c1ea9559b6a2"
|
||||
integrity sha1-rmzg1vbV4KT32JN5jQPB6pVZtqI=
|
||||
dependencies:
|
||||
mkdirp "~0.5.1"
|
||||
ncp "~2.0.0"
|
||||
rimraf "~2.4.0"
|
||||
|
||||
mz@^2.4.0:
|
||||
version "2.7.0"
|
||||
resolved "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32"
|
||||
|
@ -20520,7 +20479,7 @@ mz@^2.4.0:
|
|||
object-assign "^4.0.1"
|
||||
thenify-all "^1.0.0"
|
||||
|
||||
nan@^2.13.2, nan@^2.14.0:
|
||||
nan@^2.13.2:
|
||||
version "2.14.1"
|
||||
resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.1.tgz#d7be34dfa3105b91494c3147089315eff8874b01"
|
||||
integrity sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==
|
||||
|
@ -20596,7 +20555,7 @@ natural-compare@^1.4.0:
|
|||
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
|
||||
integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=
|
||||
|
||||
ncp@^2.0.0, ncp@~2.0.0:
|
||||
ncp@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/ncp/-/ncp-2.0.0.tgz#195a21d6c46e361d2fb1281ba38b91e9df7bdbb3"
|
||||
integrity sha1-GVoh1sRuNh0vsSgbo4uR6d9727M=
|
||||
|
@ -25253,13 +25212,6 @@ rimraf@^2.2.8, rimraf@^2.5.4, rimraf@^2.6.2, rimraf@^2.6.3:
|
|||
dependencies:
|
||||
glob "^7.1.3"
|
||||
|
||||
rimraf@~2.4.0:
|
||||
version "2.4.5"
|
||||
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.4.5.tgz#ee710ce5d93a8fdb856fb5ea8ff0e2d75934b2da"
|
||||
integrity sha1-7nEM5dk6j9uFb7Xqj/Di11k0sto=
|
||||
dependencies:
|
||||
glob "^6.0.1"
|
||||
|
||||
ripemd160@^2.0.0, ripemd160@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.1.tgz#0f4584295c53a3628af7e6d79aca21ce57d1c6e7"
|
||||
|
@ -25379,7 +25331,7 @@ safe-buffer@5.1.2, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, s
|
|||
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
|
||||
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
|
||||
|
||||
safe-json-stringify@^1.2.0, safe-json-stringify@~1:
|
||||
safe-json-stringify@^1.2.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/safe-json-stringify/-/safe-json-stringify-1.2.0.tgz#356e44bc98f1f93ce45df14bcd7c01cda86e0afd"
|
||||
integrity sha512-gH8eh2nZudPQO6TytOvbxnuhYBOvDBBLW52tz5q6X58lJcd/tkmqFR+5Z9adS8aJtURSXWThWy/xJtJwixErvg==
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue