diff --git a/src/dev/jest/config.js b/src/dev/jest/config.js index 33d889e373e2d..b01a96647c83e 100644 --- a/src/dev/jest/config.js +++ b/src/dev/jest/config.js @@ -75,6 +75,7 @@ export default { setupFilesAfterEnv: [ '/src/dev/jest/setup/mocks.js', '/src/dev/jest/setup/react_testing_library.js', + '/src/dev/jest/setup/default_timeout.js', ], coverageDirectory: '/target/kibana-coverage/jest', coverageReporters: ['html', 'text'], diff --git a/src/dev/jest/setup/default_timeout.js b/src/dev/jest/setup/default_timeout.js new file mode 100644 index 0000000000000..eea38e745b960 --- /dev/null +++ b/src/dev/jest/setup/default_timeout.js @@ -0,0 +1,25 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* eslint-env jest */ + +/** + * Set the default timeout for the unit tests to 30 seconds, temporarily + */ +jest.setTimeout(30 * 1000); diff --git a/x-pack/dev-tools/jest/create_jest_config.js b/x-pack/dev-tools/jest/create_jest_config.js index fe5de3947c33e..e5e960f9ccc85 100644 --- a/x-pack/dev-tools/jest/create_jest_config.js +++ b/x-pack/dev-tools/jest/create_jest_config.js @@ -56,6 +56,7 @@ export function createJestConfig({ kibanaDirectory, rootDir, xPackKibanaDirector `${xPackKibanaDirectory}/dev-tools/jest/setup/setup_test.js`, `${kibanaDirectory}/src/dev/jest/setup/mocks.js`, `${kibanaDirectory}/src/dev/jest/setup/react_testing_library.js`, + `${kibanaDirectory}/src/dev/jest/setup/default_timeout.js`, ], testEnvironment: 'jest-environment-jsdom-thirteen', testMatch: ['**/*.test.{js,mjs,ts,tsx}'],