diff --git a/x-pack/plugins/apm/jest.config.js b/x-pack/plugins/apm/jest.config.js index cc985407698b..5d15dd048d4f 100644 --- a/x-pack/plugins/apm/jest.config.js +++ b/x-pack/plugins/apm/jest.config.js @@ -11,10 +11,7 @@ module.exports = { preset: '@kbn/test', rootDir: path.resolve(__dirname, '../../..'), roots: ['/x-pack/plugins/apm'], - setupFiles: [ - '/x-pack/plugins/apm/jest_setup.js', - '/x-pack/plugins/apm/.storybook/jest_setup.js', - ], + setupFiles: ['/x-pack/plugins/apm/.storybook/jest_setup.js'], coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/apm', coverageReporters: ['text', 'html'], collectCoverageFrom: [ diff --git a/x-pack/plugins/apm/jest_setup.js b/x-pack/plugins/apm/jest_setup.js deleted file mode 100644 index 0c56a092850a..000000000000 --- a/x-pack/plugins/apm/jest_setup.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -/* global jest */ - -// When a `console.error` is encountered, throw the error to make the test fail. -// This effectively treats logged errors during the test run as failures. -jest.spyOn(console, 'error').mockImplementation((message, ...args) => { - console.log(message, ...args); - throw new Error(message); -});