Update dependency axios to ^0.19.0 (#37632)
* Update dependency axios to ^0.19.0 * explicitly set xhr adapter when using with sinon.server() * define axios XHR adapter in more places
This commit is contained in:
parent
b35fd86d09
commit
eb0ab65f58
|
@ -100,7 +100,7 @@
|
|||
"abab": "^1.0.4",
|
||||
"ansi-colors": "^3.0.5",
|
||||
"ansicolors": "0.3.2",
|
||||
"axios": "^0.18.0",
|
||||
"axios": "^0.19.0",
|
||||
"babel-jest": "^24.1.0",
|
||||
"babel-plugin-inline-react-svg": "1.1.0",
|
||||
"babel-plugin-mock-imports": "1.0.1",
|
||||
|
@ -198,7 +198,7 @@
|
|||
"apollo-link-state": "^0.4.1",
|
||||
"apollo-server-errors": "^2.0.2",
|
||||
"apollo-server-hapi": "^1.3.6",
|
||||
"axios": "^0.18.0",
|
||||
"axios": "^0.19.0",
|
||||
"base64-js": "^1.2.1",
|
||||
"bluebird": "3.5.5",
|
||||
"boom": "^7.2.0",
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
import axios from 'axios';
|
||||
import axiosXhrAdapter from 'axios/lib/adapters/xhr';
|
||||
|
||||
import { setHttpClient } from '../../../public/app/services/api';
|
||||
import { init as initHttpRequests } from './http_requests';
|
||||
|
@ -13,7 +14,7 @@ export const setupEnvironment = () => {
|
|||
// Mock Angular $q
|
||||
const $q = { defer: () => ({ resolve() {} }) };
|
||||
// axios has a $http like interface so using it to simulate $http
|
||||
setHttpClient(axios.create(), $q);
|
||||
setHttpClient(axios.create({ adapter: axiosXhrAdapter }), $q);
|
||||
|
||||
const { server, httpRequestsMockHelpers } = initHttpRequests();
|
||||
|
||||
|
|
|
@ -13,8 +13,9 @@ import { mountWithIntl } from '../../../../test_utils/enzyme_helpers';
|
|||
import { EditPolicy } from '../../public/sections/edit_policy';
|
||||
// axios has a $http like interface so using it to simulate $http
|
||||
import axios from 'axios';
|
||||
import axiosXhrAdapter from 'axios/lib/adapters/xhr';
|
||||
import { setHttpClient } from '../../public/services/api';
|
||||
setHttpClient(axios.create());
|
||||
setHttpClient(axios.create({ adapter: axiosXhrAdapter }));
|
||||
import sinon from 'sinon';
|
||||
import { findTestSubject } from '@elastic/eui/lib/test';
|
||||
import {
|
||||
|
|
|
@ -13,8 +13,9 @@ import { PolicyTable } from '../../public/sections/policy_table';
|
|||
import { findTestSubject, takeMountedSnapshot } from '@elastic/eui/lib/test';
|
||||
// axios has a $http like interface so using it to simulate $http
|
||||
import axios from 'axios';
|
||||
import axiosXhrAdapter from 'axios/lib/adapters/xhr';
|
||||
import { setHttpClient } from '../../public/services/api';
|
||||
setHttpClient(axios.create());
|
||||
setHttpClient(axios.create({ adapter: axiosXhrAdapter }));
|
||||
import sinon from 'sinon';
|
||||
let server = null;
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ import { BASE_PATH } from '../../common/constants';
|
|||
import { mountWithIntl } from '../../../../test_utils/enzyme_helpers';
|
||||
// axios has a $http like interface so using it to simulate $http
|
||||
import axios from 'axios';
|
||||
import axiosXhrAdapter from 'axios/lib/adapters/xhr';
|
||||
import { setHttpClient } from '../../public/services/api';
|
||||
import sinon from 'sinon';
|
||||
import { findTestSubject } from '@elastic/eui/lib/test';
|
||||
|
@ -36,7 +37,7 @@ jest.mock('react-ace', () => {
|
|||
jest.mock('brace/theme/textmate', () => 'brace/theme/textmate');
|
||||
jest.mock('brace/ext/language_tools', () => 'brace/ext/language_tools');
|
||||
|
||||
setHttpClient(axios.create());
|
||||
setHttpClient(axios.create({ adapter: axiosXhrAdapter }));
|
||||
let server = null;
|
||||
|
||||
let store = null;
|
||||
|
|
|
@ -5,13 +5,14 @@
|
|||
*/
|
||||
|
||||
import axios from 'axios';
|
||||
import axiosXhrAdapter from 'axios/lib/adapters/xhr';
|
||||
|
||||
import { setHttpClient } from '../../../public/services/api';
|
||||
import { init as initHttpRequests } from './http_requests';
|
||||
|
||||
export const setupEnvironment = () => {
|
||||
// axios has a $http like interface so using it to simulate $http
|
||||
setHttpClient(axios.create());
|
||||
setHttpClient(axios.create({ adapter: axiosXhrAdapter }));
|
||||
|
||||
const { server, httpRequestsMockHelpers } = initHttpRequests();
|
||||
|
||||
|
|
|
@ -5,13 +5,14 @@
|
|||
*/
|
||||
|
||||
import axios from 'axios';
|
||||
import axiosXhrAdapter from 'axios/lib/adapters/xhr';
|
||||
|
||||
import { setHttp } from '../../../public/crud_app/services';
|
||||
import { init as initHttpRequests } from './http_requests';
|
||||
|
||||
export const setupEnvironment = () => {
|
||||
// axios has a $http like interface so using it to simulate $http
|
||||
setHttp(axios.create());
|
||||
setHttp(axios.create({ adapter: axiosXhrAdapter }));
|
||||
|
||||
const { server, httpRequestsMockHelpers } = initHttpRequests();
|
||||
|
||||
|
|
19
yarn.lock
19
yarn.lock
|
@ -6031,6 +6031,14 @@ axios@^0.18.0:
|
|||
follow-redirects "^1.3.0"
|
||||
is-buffer "^1.1.5"
|
||||
|
||||
axios@^0.19.0:
|
||||
version "0.19.0"
|
||||
resolved "https://registry.yarnpkg.com/axios/-/axios-0.19.0.tgz#8e09bff3d9122e133f7b8101c8fbdd00ed3d2ab8"
|
||||
integrity sha512-1uvKqKQta3KBxIz14F2v06AEHZ/dIoeKfbTRkK1E5oqjDnuEerLmYTgJB5AiQZHJcljpg1TuRzdjDR06qNk0DQ==
|
||||
dependencies:
|
||||
follow-redirects "1.5.10"
|
||||
is-buffer "^2.0.2"
|
||||
|
||||
axobject-query@^2.0.2:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.0.2.tgz#ea187abe5b9002b377f925d8bf7d1c561adf38f9"
|
||||
|
@ -9713,7 +9721,7 @@ debug@2.6.9, debug@^2.0.0, debug@^2.1.0, debug@^2.1.1, debug@^2.1.2, debug@^2.2.
|
|||
dependencies:
|
||||
ms "2.0.0"
|
||||
|
||||
debug@3.1.0, debug@~3.1.0:
|
||||
debug@3.1.0, debug@=3.1.0, debug@~3.1.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
|
||||
integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==
|
||||
|
@ -12416,6 +12424,13 @@ focus-trap@^2.0.1:
|
|||
dependencies:
|
||||
tabbable "^1.0.3"
|
||||
|
||||
follow-redirects@1.5.10:
|
||||
version "1.5.10"
|
||||
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.10.tgz#7b7a9f9aea2fdff36786a94ff643ed07f4ff5e2a"
|
||||
integrity sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==
|
||||
dependencies:
|
||||
debug "=3.1.0"
|
||||
|
||||
follow-redirects@^1.3.0:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.4.1.tgz#d8120f4518190f55aac65bb6fc7b85fcd666d6aa"
|
||||
|
@ -15241,7 +15256,7 @@ is-buffer@^1.0.2, is-buffer@^1.1.4, is-buffer@^1.1.5:
|
|||
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
|
||||
integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==
|
||||
|
||||
is-buffer@^2.0.0:
|
||||
is-buffer@^2.0.0, is-buffer@^2.0.2:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.3.tgz#4ecf3fcf749cbd1e472689e109ac66261a25e725"
|
||||
integrity sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==
|
||||
|
|
Loading…
Reference in a new issue