diff --git a/src/core_plugins/console/public/tests/src/input_tokenization.test.js b/src/core_plugins/console/public/tests/src/input_tokenization.test.js index cd242fa056f4a..0b92a4a3ede22 100644 --- a/src/core_plugins/console/public/tests/src/input_tokenization.test.js +++ b/src/core_plugins/console/public/tests/src/input_tokenization.test.js @@ -16,13 +16,13 @@ * specific language governing permissions and limitations * under the License. */ + import './setup_mocks'; import ace from 'brace'; import 'brace/mode/json'; -const $ = require('jquery'); +import $ from 'jquery'; import { initializeInput } from '../../src/input'; - const tokenIterator = ace.acequire('ace/token_iterator'); describe('Input Tokenization', () => { diff --git a/src/core_plugins/console/public/tests/src/setup_mocks.js b/src/core_plugins/console/public/tests/src/setup_mocks.js index c30b07d8b4c81..0bcf75e29f5f3 100644 --- a/src/core_plugins/console/public/tests/src/setup_mocks.js +++ b/src/core_plugins/console/public/tests/src/setup_mocks.js @@ -23,4 +23,10 @@ window.URL = { createObjectURL: () => { return ''; } }; jest.mock('../../src/storage'); -document.queryCommandSupported = () => true; \ No newline at end of file + +document.queryCommandSupported = () => true; + +import jQuery from 'jquery'; +jest.spyOn(jQuery, 'ajax').mockImplementation(() => new Promise(() => { + // never resolve +})); diff --git a/src/dev/jest/config.js b/src/dev/jest/config.js index 4bb11a6d43785..99b22b14c2d71 100644 --- a/src/dev/jest/config.js +++ b/src/dev/jest/config.js @@ -96,6 +96,4 @@ export default { 'default', '/src/dev/jest/junit_reporter.js', ], - // TODO: prevent tests from making web requests that rely on this setting, see https://github.com/facebook/jest/pull/6792 - testURL: 'about:blank', }; diff --git a/src/ui/public/share/components/__snapshots__/url_panel_content.test.js.snap b/src/ui/public/share/components/__snapshots__/url_panel_content.test.js.snap index fa35bd2116479..f7aca23d019d9 100644 --- a/src/ui/public/share/components/__snapshots__/url_panel_content.test.js.snap +++ b/src/ui/public/share/components/__snapshots__/url_panel_content.test.js.snap @@ -129,7 +129,7 @@ exports[`render 1`] = ` `; @@ -262,7 +262,7 @@ exports[`should enable saved object export option when objectId is provided 1`] `; diff --git a/x-pack/dev-tools/jest/create_jest_config.js b/x-pack/dev-tools/jest/create_jest_config.js index 305b26917bcda..f22bb3dc88035 100644 --- a/x-pack/dev-tools/jest/create_jest_config.js +++ b/x-pack/dev-tools/jest/create_jest_config.js @@ -51,7 +51,5 @@ export function createJestConfig({ rootDirectory: xPackKibanaDirectory, }] ], - // TODO: prevent tests from making web requests that rely on this setting, see https://github.com/facebook/jest/pull/6792 - testURL: 'about:blank', }; }