diff --git a/dev_docs/key_concepts/anatomy_of_a_plugin.mdx b/dev_docs/key_concepts/anatomy_of_a_plugin.mdx index fa0aae2299bb01..6a6f4f8b500a85 100644 --- a/dev_docs/key_concepts/anatomy_of_a_plugin.mdx +++ b/dev_docs/key_concepts/anatomy_of_a_plugin.mdx @@ -32,6 +32,7 @@ plugins/ plugin.ts common index.ts + jest.config.js ``` ### kibana.json @@ -209,6 +210,29 @@ considerations related to how plugins integrate with core APIs and APIs exposed `common/index.ts` is the entry-point into code that can be used both server-side or client side. +### jest.config.js + +If you are adding unit tests (which we recommend), you will need to add a `jest.config.js` file. Here is an example file that you would use if adding a plugin into the `examples` directory. + +```js +module.exports = { + // Default Jest settings, defined in kbn-test package + preset: '@kbn/test', + // The root of the directory containing package.json + rootDir: '../../..', + // The directory which Jest should use to search for files in + roots: ['/src/plugins/demo'], + // The directory where Jest should output plugin coverage details, e.g. html report + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/demo', + // A list of reporter names that Jest uses when writing coverage reports, default: ["json"] + // "text" is available in console and is good for quick check + // "html" helps to dig into specific files and fix coverage + coverageReporters: ['text', 'html'], + // An array of regexp pattern strings that matched files to include/exclude for code coverage + collectCoverageFrom: ['/src/plugins/demo/{common,public,server}/**/*.{ts,tsx}'], +}; +``` + ## How plugin's interact with each other, and Core The lifecycle-specific contracts exposed by core services are always passed as the first argument to the equivalent lifecycle function in a plugin. diff --git a/dev_docs/tutorials/testing_plugins.mdx b/dev_docs/tutorials/testing_plugins.mdx index 55b662421cbd07..bc92af33d34935 100644 --- a/dev_docs/tutorials/testing_plugins.mdx +++ b/dev_docs/tutorials/testing_plugins.mdx @@ -928,6 +928,17 @@ describe('Case migrations v7.7.0 -> v7.8.0', () => { }); ``` +You can generate code coverage report for a single plugin. + +```bash +yarn jest --coverage --config src/plugins/console/jest.config.js +``` + +Html report should be available in `target/kibana-coverage/jest/src/plugins/console` path + +We run code coverage daily on CI and ["Kibana Stats cluster"](https://kibana-stats.elastic.dev/s/code-coverage/app/home) +can be used to view statistics. The report combines code coverage for all jest tests within Kibana repository. + #### Integration testing With more complicated migrations, the behavior of the migration may be dependent on values from other plugins which may be difficult or even impossible to test with unit tests. You need to actually bootstrap Kibana, load the plugins, and diff --git a/docs/developer/contributing/development-tests.asciidoc b/docs/developer/contributing/development-tests.asciidoc index e7a36d28667282..340e122b44c1b9 100644 --- a/docs/developer/contributing/development-tests.asciidoc +++ b/docs/developer/contributing/development-tests.asciidoc @@ -56,6 +56,14 @@ kibana/src/plugins/dashboard/server$ yarn test:jest --coverage yarn jest --coverage --verbose --config /home/tyler/elastic/kibana/src/plugins/dashboard/jest.config.js server ---- +You can generate code coverage report for a single plugin. + +[source,bash] +---- +yarn jest --coverage --config src/plugins/console/jest.config.js +---- + +Html report is available in target/kibana-coverage/jest/path/to/plugin [discrete] === Running browser automation tests diff --git a/packages/kbn-ui-framework/README.md b/packages/kbn-ui-framework/README.md index 6ee1c407dad5da..b6a43d8e283531 100644 --- a/packages/kbn-ui-framework/README.md +++ b/packages/kbn-ui-framework/README.md @@ -19,6 +19,9 @@ You can run `node scripts/jest --watch` to watch for changes and run the tests a You can run `node scripts/jest --coverage` to generate a code coverage report to see how fully-tested the code is. +You can run `node scripts/jest --config path/to/plugin/jest.config.js --coverage` to generate +a code coverage report for a single plugin. + See the documentation in [`scripts/jest.js`](../scripts/jest.js) for more options. ## Creating components diff --git a/src/plugins/advanced_settings/jest.config.js b/src/plugins/advanced_settings/jest.config.js index 61909cd432df4c..7900d7f39b6c63 100644 --- a/src/plugins/advanced_settings/jest.config.js +++ b/src/plugins/advanced_settings/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/advanced_settings'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/advanced_settings', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/advanced_settings/{public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/bfetch/jest.config.js b/src/plugins/bfetch/jest.config.js index 544328ed4baf3e..d01c81c8f1d821 100644 --- a/src/plugins/bfetch/jest.config.js +++ b/src/plugins/bfetch/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/bfetch'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/bfetch', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/bfetch/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/chart_expressions/expression_tagcloud/jest.config.js b/src/plugins/chart_expressions/expression_tagcloud/jest.config.js index c88c150d6f6492..412a133b0d2927 100644 --- a/src/plugins/chart_expressions/expression_tagcloud/jest.config.js +++ b/src/plugins/chart_expressions/expression_tagcloud/jest.config.js @@ -10,4 +10,10 @@ module.exports = { preset: '@kbn/test', rootDir: '../../../../', roots: ['/src/plugins/chart_expressions/expression_tagcloud'], + coverageDirectory: + '/target/kibana-coverage/jest/src/plugins/chart_expressions/expression_tagcloud', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/chart_expressions/expression_tagcloud/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/charts/jest.config.js b/src/plugins/charts/jest.config.js index b6516c520ecf67..a4469b78b3306c 100644 --- a/src/plugins/charts/jest.config.js +++ b/src/plugins/charts/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/charts'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/charts', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/charts/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/console/jest.config.js b/src/plugins/console/jest.config.js index 0fc1bcbcfb2014..08dbc96e0136cf 100644 --- a/src/plugins/console/jest.config.js +++ b/src/plugins/console/jest.config.js @@ -11,4 +11,7 @@ module.exports = { rootDir: '../../..', roots: ['/src/plugins/console'], testRunner: 'jasmine2', + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/console', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/console/{common,public,server}/**/*.{js,ts,tsx}'], }; diff --git a/src/plugins/dashboard/jest.config.js b/src/plugins/dashboard/jest.config.js index 0b9ac0428c3af6..d99cfe57fcd37f 100644 --- a/src/plugins/dashboard/jest.config.js +++ b/src/plugins/dashboard/jest.config.js @@ -11,4 +11,7 @@ module.exports = { rootDir: '../../..', roots: ['/src/plugins/dashboard'], testRunner: 'jasmine2', + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/dashboard', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/dashboard/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/data/jest.config.js b/src/plugins/data/jest.config.js index eba30c6cfd674f..f8ab0e348376e7 100644 --- a/src/plugins/data/jest.config.js +++ b/src/plugins/data/jest.config.js @@ -11,4 +11,7 @@ module.exports = { rootDir: '../../..', roots: ['/src/plugins/data'], testRunner: 'jasmine2', + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/data', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/data/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/discover/jest.config.js b/src/plugins/discover/jest.config.js index 4c0f09b2cc242e..00f5d8016e3c45 100644 --- a/src/plugins/discover/jest.config.js +++ b/src/plugins/discover/jest.config.js @@ -11,4 +11,7 @@ module.exports = { rootDir: '../../..', roots: ['/src/plugins/discover'], testRunner: 'jasmine2', + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/discover', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/discover/{common,public,server}/**/*.{js,ts,tsx}'], }; diff --git a/src/plugins/embeddable/jest.config.js b/src/plugins/embeddable/jest.config.js index 6ac4e4486fcfd8..37080a605e3d53 100644 --- a/src/plugins/embeddable/jest.config.js +++ b/src/plugins/embeddable/jest.config.js @@ -11,4 +11,7 @@ module.exports = { rootDir: '../../..', roots: ['/src/plugins/embeddable'], testRunner: 'jasmine2', + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/embeddable', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/embeddable/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/es_ui_shared/jest.config.js b/src/plugins/es_ui_shared/jest.config.js index cf525397bd75c6..c311f5d9df2edf 100644 --- a/src/plugins/es_ui_shared/jest.config.js +++ b/src/plugins/es_ui_shared/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/es_ui_shared'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/es_ui_shared', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/es_ui_shared/{__packages_do_not_import__,common,public,server,static}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/expression_error/jest.config.js b/src/plugins/expression_error/jest.config.js index 64f3e9292ff073..27774f4003f9e1 100644 --- a/src/plugins/expression_error/jest.config.js +++ b/src/plugins/expression_error/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/expression_error'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/expression_error', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/expression_error/{common,public}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/expression_image/jest.config.js b/src/plugins/expression_image/jest.config.js index 3d5bc9f184c6a4..ccefa3c20699e9 100644 --- a/src/plugins/expression_image/jest.config.js +++ b/src/plugins/expression_image/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/expression_image'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/expression_image', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/expression_image/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/expression_metric/jest.config.js b/src/plugins/expression_metric/jest.config.js index 517409460895e6..23546fc3348160 100644 --- a/src/plugins/expression_metric/jest.config.js +++ b/src/plugins/expression_metric/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/expression_metric'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/expression_metric', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/expression_metric/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/expression_repeat_image/jest.config.js b/src/plugins/expression_repeat_image/jest.config.js index cf1039263840b0..b30d782ef6e0ea 100644 --- a/src/plugins/expression_repeat_image/jest.config.js +++ b/src/plugins/expression_repeat_image/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/expression_repeat_image'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/expression_repeat_image', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/expression_repeat_image/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/expression_reveal_image/jest.config.js b/src/plugins/expression_reveal_image/jest.config.js index aac5fad293846b..c1d7fead721f5a 100644 --- a/src/plugins/expression_reveal_image/jest.config.js +++ b/src/plugins/expression_reveal_image/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/expression_reveal_image'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/expression_reveal_image', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/expression_reveal_image/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/expression_shape/jest.config.js b/src/plugins/expression_shape/jest.config.js index a390c0154bbd0b..bb2603cb012eb2 100644 --- a/src/plugins/expression_shape/jest.config.js +++ b/src/plugins/expression_shape/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/expression_shape'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/expression_shape', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/expression_shape/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/expressions/jest.config.js b/src/plugins/expressions/jest.config.js index 721312f7d886c7..24f27aadedd7bd 100644 --- a/src/plugins/expressions/jest.config.js +++ b/src/plugins/expressions/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/expressions'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/expressions', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/expressions/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/field_formats/jest.config.js b/src/plugins/field_formats/jest.config.js index ea20fcfec6d099..6fc68ab97526e5 100644 --- a/src/plugins/field_formats/jest.config.js +++ b/src/plugins/field_formats/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/field_formats'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/field_formats', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/field_formats/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/home/jest.config.js b/src/plugins/home/jest.config.js index 5107cc001d32fd..c7450ebbf3104d 100644 --- a/src/plugins/home/jest.config.js +++ b/src/plugins/home/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/home'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/home', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/home/{common,public,server}/**/*.{js,ts,tsx}'], }; diff --git a/src/plugins/index_pattern_editor/jest.config.js b/src/plugins/index_pattern_editor/jest.config.js index 0a018a42d06e6b..bdf5fd8a0e9e20 100644 --- a/src/plugins/index_pattern_editor/jest.config.js +++ b/src/plugins/index_pattern_editor/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/index_pattern_editor'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/index_pattern_editor', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/index_pattern_editor/public/**/*.{ts,tsx}'], }; diff --git a/src/plugins/index_pattern_field_editor/jest.config.js b/src/plugins/index_pattern_field_editor/jest.config.js index fc358c37116c98..e1f8f57038e26d 100644 --- a/src/plugins/index_pattern_field_editor/jest.config.js +++ b/src/plugins/index_pattern_field_editor/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/index_pattern_field_editor'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/index_pattern_field_editor', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/index_pattern_field_editor/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/index_pattern_management/jest.config.js b/src/plugins/index_pattern_management/jest.config.js index 8383d3bb6110d0..6249d44e6b31fb 100644 --- a/src/plugins/index_pattern_management/jest.config.js +++ b/src/plugins/index_pattern_management/jest.config.js @@ -11,4 +11,9 @@ module.exports = { rootDir: '../../..', roots: ['/src/plugins/index_pattern_management'], testRunner: 'jasmine2', + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/index_pattern_management', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/index_pattern_management/{public,server}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/input_control_vis/jest.config.js b/src/plugins/input_control_vis/jest.config.js index 060ab9ff1a126a..207a0b52654172 100644 --- a/src/plugins/input_control_vis/jest.config.js +++ b/src/plugins/input_control_vis/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/input_control_vis'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/input_control_vis', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/input_control_vis/public/**/*.{ts,tsx}'], }; diff --git a/src/plugins/inspector/jest.config.js b/src/plugins/inspector/jest.config.js index 67e90f449fa767..3583a69a94bd9b 100644 --- a/src/plugins/inspector/jest.config.js +++ b/src/plugins/inspector/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/inspector'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/inspector', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/inspector/{common,public}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/kibana_legacy/jest.config.js b/src/plugins/kibana_legacy/jest.config.js index c9b571b13f13f8..a2bdf5649f900f 100644 --- a/src/plugins/kibana_legacy/jest.config.js +++ b/src/plugins/kibana_legacy/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/kibana_legacy'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/kibana_legacy', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/kibana_legacy/public/**/*.{js,ts,tsx}'], }; diff --git a/src/plugins/kibana_overview/jest.config.js b/src/plugins/kibana_overview/jest.config.js index 4862a4967a3cad..00cf46dfe2f805 100644 --- a/src/plugins/kibana_overview/jest.config.js +++ b/src/plugins/kibana_overview/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/kibana_overview'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/kibana_overview', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/kibana_overview/{common,public}/**/*.{js,ts,tsx}'], }; diff --git a/src/plugins/kibana_react/jest.config.js b/src/plugins/kibana_react/jest.config.js index 159f7b01795dc6..35bf9df51d6150 100644 --- a/src/plugins/kibana_react/jest.config.js +++ b/src/plugins/kibana_react/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/kibana_react'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/kibana_react', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/kibana_react/{common,public}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/kibana_usage_collection/jest.config.js b/src/plugins/kibana_usage_collection/jest.config.js index f199984a6ad6d6..a52c3eb8cc06c6 100644 --- a/src/plugins/kibana_usage_collection/jest.config.js +++ b/src/plugins/kibana_usage_collection/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/kibana_usage_collection'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/kibana_usage_collection', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/kibana_usage_collection/{common,server}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/kibana_utils/jest.config.js b/src/plugins/kibana_utils/jest.config.js index 48b7bb62a8e68f..a01ededd1e7c05 100644 --- a/src/plugins/kibana_utils/jest.config.js +++ b/src/plugins/kibana_utils/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/kibana_utils'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/kibana_utils', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/kibana_utils/{common,demos,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/legacy_export/jest.config.js b/src/plugins/legacy_export/jest.config.js index d5dd37c8249f9a..3aa4ea98ff4803 100644 --- a/src/plugins/legacy_export/jest.config.js +++ b/src/plugins/legacy_export/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/legacy_export'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/legacy_export', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/interactive_setup/public/**/*.{ts,tsx}'], }; diff --git a/src/plugins/management/jest.config.js b/src/plugins/management/jest.config.js index e821012e9dc2eb..ee5e50a7536932 100644 --- a/src/plugins/management/jest.config.js +++ b/src/plugins/management/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/management'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/management', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/management/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/maps_ems/jest.config.js b/src/plugins/maps_ems/jest.config.js index b7021c9119deb6..4e2b09bb663054 100644 --- a/src/plugins/maps_ems/jest.config.js +++ b/src/plugins/maps_ems/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/maps_ems'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/maps_ems', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/maps_ems/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/navigation/jest.config.js b/src/plugins/navigation/jest.config.js index 98cd0e3760a175..e31374a542563f 100644 --- a/src/plugins/navigation/jest.config.js +++ b/src/plugins/navigation/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/navigation'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/navigation', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/navigation/public/**/*.{ts,tsx}'], }; diff --git a/src/plugins/newsfeed/jest.config.js b/src/plugins/newsfeed/jest.config.js index 580185836c978e..43caa9227b9f6e 100644 --- a/src/plugins/newsfeed/jest.config.js +++ b/src/plugins/newsfeed/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/newsfeed'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/newsfeed', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/newsfeed/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/presentation_util/jest.config.js b/src/plugins/presentation_util/jest.config.js index 2250d70acb4755..cb1e18fd6d736a 100644 --- a/src/plugins/presentation_util/jest.config.js +++ b/src/plugins/presentation_util/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/presentation_util'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/presentation_util', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/presentation_util/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/saved_objects/jest.config.js b/src/plugins/saved_objects/jest.config.js index 77848e0dc6ed5b..416385af2d2140 100644 --- a/src/plugins/saved_objects/jest.config.js +++ b/src/plugins/saved_objects/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/saved_objects'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/saved_objects', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/saved_objects/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/saved_objects_management/jest.config.js b/src/plugins/saved_objects_management/jest.config.js index a8fd7db1b7b45d..e986e5a310eaeb 100644 --- a/src/plugins/saved_objects_management/jest.config.js +++ b/src/plugins/saved_objects_management/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/saved_objects_management'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/saved_objects_management', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/saved_objects_management/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/saved_objects_tagging_oss/jest.config.js b/src/plugins/saved_objects_tagging_oss/jest.config.js index adb5b1e4261800..e7b571e955ef15 100644 --- a/src/plugins/saved_objects_tagging_oss/jest.config.js +++ b/src/plugins/saved_objects_tagging_oss/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/saved_objects_tagging_oss'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/saved_objects_tagging_oss', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/saved_objects_tagging_oss/{common,public}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/screenshot_mode/jest.config.js b/src/plugins/screenshot_mode/jest.config.js index e84f3742f8c1d9..e108ab786739f8 100644 --- a/src/plugins/screenshot_mode/jest.config.js +++ b/src/plugins/screenshot_mode/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/screenshot_mode'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/screenshot_mode', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/screenshot_mode/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/security_oss/jest.config.js b/src/plugins/security_oss/jest.config.js index c62cad7e72cecc..692d85f69a7405 100644 --- a/src/plugins/security_oss/jest.config.js +++ b/src/plugins/security_oss/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/security_oss'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/security_oss', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/security_oss/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/share/jest.config.js b/src/plugins/share/jest.config.js index f347067849f71c..aae58e3c57d1f3 100644 --- a/src/plugins/share/jest.config.js +++ b/src/plugins/share/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/share'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/share', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/share/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/telemetry/jest.config.js b/src/plugins/telemetry/jest.config.js index 61e042b40b5d4a..932c3c28513823 100644 --- a/src/plugins/telemetry/jest.config.js +++ b/src/plugins/telemetry/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/telemetry'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/telemetry', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/telemetry/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/telemetry_collection_manager/jest.config.js b/src/plugins/telemetry_collection_manager/jest.config.js index f9615de4ab60a9..7f58aa46cabf23 100644 --- a/src/plugins/telemetry_collection_manager/jest.config.js +++ b/src/plugins/telemetry_collection_manager/jest.config.js @@ -10,4 +10,10 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/telemetry_collection_manager'], + coverageDirectory: + '/target/kibana-coverage/jest/src/plugins/telemetry_collection_manager', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/telemetry_collection_manager/{common,server}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/telemetry_management_section/jest.config.js b/src/plugins/telemetry_management_section/jest.config.js index e1001bc787589f..722496905de9ef 100644 --- a/src/plugins/telemetry_management_section/jest.config.js +++ b/src/plugins/telemetry_management_section/jest.config.js @@ -10,4 +10,8 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/telemetry_management_section'], + coverageDirectory: + '/target/kibana-coverage/jest/src/plugins/telemetry_management_section', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/telemetry_management_section/public/**/*.{ts,tsx}'], }; diff --git a/src/plugins/ui_actions/jest.config.js b/src/plugins/ui_actions/jest.config.js index 8ee6a40e195416..f4825743166323 100644 --- a/src/plugins/ui_actions/jest.config.js +++ b/src/plugins/ui_actions/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/ui_actions'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/ui_actions', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/ui_actions/public/**/*.{ts,tsx}'], }; diff --git a/src/plugins/url_forwarding/jest.config.js b/src/plugins/url_forwarding/jest.config.js index 5e452d70753d59..24a72465626f61 100644 --- a/src/plugins/url_forwarding/jest.config.js +++ b/src/plugins/url_forwarding/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/url_forwarding'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/url_forwarding', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/url_forwarding/public/**/*.{ts,tsx}'], }; diff --git a/src/plugins/usage_collection/jest.config.js b/src/plugins/usage_collection/jest.config.js index 25994eeec98209..f93d12327cc1b3 100644 --- a/src/plugins/usage_collection/jest.config.js +++ b/src/plugins/usage_collection/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/usage_collection'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/usage_collection', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/usage_collection/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/vis_default_editor/jest.config.js b/src/plugins/vis_default_editor/jest.config.js index 52276e29c46c4c..c921db167c1e97 100644 --- a/src/plugins/vis_default_editor/jest.config.js +++ b/src/plugins/vis_default_editor/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/vis_default_editor'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/vis_default_editor', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/vis_default_editor/public/**/*.{ts,tsx}'], }; diff --git a/src/plugins/vis_type_markdown/jest.config.js b/src/plugins/vis_type_markdown/jest.config.js index 8c73fde8d66188..835d37312eadd1 100644 --- a/src/plugins/vis_type_markdown/jest.config.js +++ b/src/plugins/vis_type_markdown/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/vis_type_markdown'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/vis_type_markdown', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/vis_type_markdown/{public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/vis_type_table/jest.config.js b/src/plugins/vis_type_table/jest.config.js index 9c91b1b813e52c..a5a925eada3f17 100644 --- a/src/plugins/vis_type_table/jest.config.js +++ b/src/plugins/vis_type_table/jest.config.js @@ -11,5 +11,9 @@ module.exports = { rootDir: '../../..', roots: ['/src/plugins/vis_type_table'], testRunner: 'jasmine2', - collectCoverageFrom: ['/src/plugins/vis_type_table/**/*.{js,ts,tsx}'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/vis_type_table', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/vis_type_table/{common,public,server}/**/*.{js,ts,tsx}', + ], }; diff --git a/src/plugins/vis_type_timelion/jest.config.js b/src/plugins/vis_type_timelion/jest.config.js index ed4eedaee2fbfb..5da416935adb9f 100644 --- a/src/plugins/vis_type_timelion/jest.config.js +++ b/src/plugins/vis_type_timelion/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/vis_type_timelion'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/vis_type_timelion', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/vis_type_timelion/{common,public,server}/**/*.{js,ts,tsx}', + ], }; diff --git a/src/plugins/vis_type_timeseries/jest.config.js b/src/plugins/vis_type_timeseries/jest.config.js index 5007d995edc44d..3d4333675f7d76 100644 --- a/src/plugins/vis_type_timeseries/jest.config.js +++ b/src/plugins/vis_type_timeseries/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/vis_type_timeseries'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/vis_type_timeseries', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/vis_type_timeseries/{common,public,server}/**/*.{js,ts,tsx}', + ], }; diff --git a/src/plugins/vis_types/metric/jest.config.js b/src/plugins/vis_types/metric/jest.config.js index a84929a3805b8a..e6de1dd63b34d1 100644 --- a/src/plugins/vis_types/metric/jest.config.js +++ b/src/plugins/vis_types/metric/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../../..', roots: ['/src/plugins/vis_types/metric'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/vis_types/metric', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/vis_types/metric/{public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/vis_types/pie/jest.config.js b/src/plugins/vis_types/pie/jest.config.js index 505ea97f489f7e..d9afd1d718c85e 100644 --- a/src/plugins/vis_types/pie/jest.config.js +++ b/src/plugins/vis_types/pie/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../../..', roots: ['/src/plugins/vis_types/pie'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/vis_types/pie', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/vis_types/pie/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/vis_types/tagcloud/jest.config.js b/src/plugins/vis_types/tagcloud/jest.config.js index 20dfd8ad0d11cc..9785690d5e8b48 100644 --- a/src/plugins/vis_types/tagcloud/jest.config.js +++ b/src/plugins/vis_types/tagcloud/jest.config.js @@ -11,4 +11,7 @@ module.exports = { rootDir: '../../../..', roots: ['/src/plugins/vis_types/tagcloud'], testRunner: 'jasmine2', + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/vis_types/tagcloud', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/vis_types/tagcloud/{public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/vis_types/vega/jest.config.js b/src/plugins/vis_types/vega/jest.config.js index d7e1653e891a54..33c2d8e7aa1ed0 100644 --- a/src/plugins/vis_types/vega/jest.config.js +++ b/src/plugins/vis_types/vega/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../../..', roots: ['/src/plugins/vis_types/vega'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/vis_types/vega', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/vis_types/vega/{public,server}/**/*.{js,ts,tsx}'], }; diff --git a/src/plugins/vis_types/vislib/jest.config.js b/src/plugins/vis_types/vislib/jest.config.js index 6b6d7c3361ecfe..cc80a320765d8a 100644 --- a/src/plugins/vis_types/vislib/jest.config.js +++ b/src/plugins/vis_types/vislib/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../../..', roots: ['/src/plugins/vis_types/vislib'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/vis_types/vislib', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/vis_types/vislib/{common,public,server}/**/*.{js,ts,tsx}', + ], }; diff --git a/src/plugins/vis_types/xy/jest.config.js b/src/plugins/vis_types/xy/jest.config.js index 57b041b575e3f0..4cdb8f44012c7c 100644 --- a/src/plugins/vis_types/xy/jest.config.js +++ b/src/plugins/vis_types/xy/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../../..', roots: ['/src/plugins/vis_types/xy'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/vis_types/xy', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/vis_types/xy/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/visualizations/jest.config.js b/src/plugins/visualizations/jest.config.js index 250bdc44e4de5a..450e30a1de24d0 100644 --- a/src/plugins/visualizations/jest.config.js +++ b/src/plugins/visualizations/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/visualizations'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/visualizations', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/visualizations/{common,public,server}/**/*.{js,ts,tsx}', + ], }; diff --git a/src/plugins/visualize/jest.config.js b/src/plugins/visualize/jest.config.js index 22a9ffa161253c..11ea368f57d259 100644 --- a/src/plugins/visualize/jest.config.js +++ b/src/plugins/visualize/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/visualize'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/visualize', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/visualize/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/actions/jest.config.js b/x-pack/plugins/actions/jest.config.js index 3a9fb5019494ad..2d3372a91890ae 100644 --- a/x-pack/plugins/actions/jest.config.js +++ b/x-pack/plugins/actions/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/actions'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/actions', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/actions/{common,server}/**/*.{js,ts,tsx}'], }; diff --git a/x-pack/plugins/alerting/jest.config.js b/x-pack/plugins/alerting/jest.config.js index 1f34005415cca8..05db974299b401 100644 --- a/x-pack/plugins/alerting/jest.config.js +++ b/x-pack/plugins/alerting/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/alerting'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/alerting', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/alerting/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/apm/jest.config.js b/x-pack/plugins/apm/jest.config.js index 5bce9bbfb5b1be..77639cb58d497a 100644 --- a/x-pack/plugins/apm/jest.config.js +++ b/x-pack/plugins/apm/jest.config.js @@ -13,4 +13,9 @@ module.exports = { roots: ['/x-pack/plugins/apm'], setupFiles: ['/x-pack/plugins/apm/.storybook/jest_setup.js'], testPathIgnorePatterns: ['/x-pack/plugins/apm/e2e/'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/apm', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/apm/{common,public,server}/**/*.{js,ts,tsx}', + ], }; diff --git a/x-pack/plugins/banners/jest.config.js b/x-pack/plugins/banners/jest.config.js index e2d103c8e4a284..291bdb34362959 100644 --- a/x-pack/plugins/banners/jest.config.js +++ b/x-pack/plugins/banners/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/banners'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/banners', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/banners/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/canvas/jest.config.js b/x-pack/plugins/canvas/jest.config.js index 7524e06159a412..2bff284e94ad8b 100644 --- a/x-pack/plugins/canvas/jest.config.js +++ b/x-pack/plugins/canvas/jest.config.js @@ -12,4 +12,9 @@ module.exports = { transform: { '^.+\\.stories\\.tsx?$': '@storybook/addon-storyshots/injectFileName', }, + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/canvas', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/canvas/{canvas_plugin_src,common,i18n,public,server,shareable_runtime}/**/*.{js,ts,tsx}', + ], }; diff --git a/x-pack/plugins/cases/jest.config.js b/x-pack/plugins/cases/jest.config.js index 6368eb8895ad15..3b1b0b12231919 100644 --- a/x-pack/plugins/cases/jest.config.js +++ b/x-pack/plugins/cases/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/cases'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/cases', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/cases/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/cloud/jest.config.js b/x-pack/plugins/cloud/jest.config.js index 68f63b4d8b5acd..4235e79e79268e 100644 --- a/x-pack/plugins/cloud/jest.config.js +++ b/x-pack/plugins/cloud/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/cloud'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/cloud', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/cloud/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/cross_cluster_replication/jest.config.js b/x-pack/plugins/cross_cluster_replication/jest.config.js index 8d39781213dbd8..87d557b57a6a73 100644 --- a/x-pack/plugins/cross_cluster_replication/jest.config.js +++ b/x-pack/plugins/cross_cluster_replication/jest.config.js @@ -9,4 +9,10 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/cross_cluster_replication'], + coverageDirectory: + '/target/kibana-coverage/jest/x-pack/plugins/cross_cluster_replication', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/cross_cluster_replication/{common,public,server}/**/*.{js,ts,tsx}', + ], }; diff --git a/x-pack/plugins/dashboard_enhanced/jest.config.js b/x-pack/plugins/dashboard_enhanced/jest.config.js index 8ade9e0a09f5e5..86ae949431e696 100644 --- a/x-pack/plugins/dashboard_enhanced/jest.config.js +++ b/x-pack/plugins/dashboard_enhanced/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/dashboard_enhanced'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/dashboard_enhanced', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/dashboard_enhanced/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/x-pack/plugins/data_enhanced/jest.config.js b/x-pack/plugins/data_enhanced/jest.config.js index 62b54b1ba36bc4..e48de352c2075f 100644 --- a/x-pack/plugins/data_enhanced/jest.config.js +++ b/x-pack/plugins/data_enhanced/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/data_enhanced'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/data_enhanced', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/data_enhanced/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/x-pack/plugins/data_visualizer/jest.config.js b/x-pack/plugins/data_visualizer/jest.config.js index 1c4974471bd79a..46de590b709bb2 100644 --- a/x-pack/plugins/data_visualizer/jest.config.js +++ b/x-pack/plugins/data_visualizer/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/data_visualizer'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/data_visualizer', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/data_visualizer/{common,public,server}/**/*.{js,ts,tsx}', + ], }; diff --git a/x-pack/plugins/discover_enhanced/jest.config.js b/x-pack/plugins/discover_enhanced/jest.config.js index 7ef1b0e858ef18..603298832dd61e 100644 --- a/x-pack/plugins/discover_enhanced/jest.config.js +++ b/x-pack/plugins/discover_enhanced/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/discover_enhanced'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/discover_enhanced', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/discover_enhanced/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/x-pack/plugins/drilldowns/jest.config.js b/x-pack/plugins/drilldowns/jest.config.js index 39259ca43b3b84..a5db93a916ebb3 100644 --- a/x-pack/plugins/drilldowns/jest.config.js +++ b/x-pack/plugins/drilldowns/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/drilldowns'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/drilldowns', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/drilldowns/url_drilldown/public/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/embeddable_enhanced/jest.config.js b/x-pack/plugins/embeddable_enhanced/jest.config.js index 47b539ca226cd6..fc9eaec5c972c9 100644 --- a/x-pack/plugins/embeddable_enhanced/jest.config.js +++ b/x-pack/plugins/embeddable_enhanced/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/embeddable_enhanced'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/embeddable_enhanced', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/embeddable_enhanced/public/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/encrypted_saved_objects/jest.config.js b/x-pack/plugins/encrypted_saved_objects/jest.config.js index 213484c8e159dd..78bfae78227dbb 100644 --- a/x-pack/plugins/encrypted_saved_objects/jest.config.js +++ b/x-pack/plugins/encrypted_saved_objects/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/encrypted_saved_objects'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/encrypted_saved_objects', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/encrypted_saved_objects/server/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/enterprise_search/jest.config.js b/x-pack/plugins/enterprise_search/jest.config.js index 7d10d7aa87bf26..263713697b7e0e 100644 --- a/x-pack/plugins/enterprise_search/jest.config.js +++ b/x-pack/plugins/enterprise_search/jest.config.js @@ -10,11 +10,12 @@ module.exports = { rootDir: '../../..', roots: ['/x-pack/plugins/enterprise_search'], collectCoverage: true, - coverageReporters: ['text'], + coverageReporters: ['text', 'html'], collectCoverageFrom: [ '/x-pack/plugins/enterprise_search/**/*.{ts,tsx}', '!/x-pack/plugins/enterprise_search/public/*.ts', '!/x-pack/plugins/enterprise_search/server/*.ts', '!/x-pack/plugins/enterprise_search/public/applications/test_helpers/**/*.{ts,tsx}', ], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/enterprise_search', }; diff --git a/x-pack/plugins/event_log/jest.config.js b/x-pack/plugins/event_log/jest.config.js index de892b297deb93..c8bf86db09e0f4 100644 --- a/x-pack/plugins/event_log/jest.config.js +++ b/x-pack/plugins/event_log/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/event_log'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/event_log', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/event_log/{common,server}/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/features/jest.config.js b/x-pack/plugins/features/jest.config.js index c39da2a15d2a2d..7d333047c491fb 100644 --- a/x-pack/plugins/features/jest.config.js +++ b/x-pack/plugins/features/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/features'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/features', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/features/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/file_upload/jest.config.js b/x-pack/plugins/file_upload/jest.config.js index b9a58c259b3173..92b3c27c74f113 100644 --- a/x-pack/plugins/file_upload/jest.config.js +++ b/x-pack/plugins/file_upload/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/file_upload'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/file_upload', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/file_upload/{common,public,server}/**/*.{js,ts,tsx}', + ], }; diff --git a/x-pack/plugins/fleet/jest.config.js b/x-pack/plugins/fleet/jest.config.js index f55b9b45140bf9..5443318d52c8df 100644 --- a/x-pack/plugins/fleet/jest.config.js +++ b/x-pack/plugins/fleet/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/fleet'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/fleet', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/fleet/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/global_search/jest.config.js b/x-pack/plugins/global_search/jest.config.js index ed945fcb8e605a..ba4c8130c375cd 100644 --- a/x-pack/plugins/global_search/jest.config.js +++ b/x-pack/plugins/global_search/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/global_search'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/global_search', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/global_search/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/x-pack/plugins/global_search_bar/jest.config.js b/x-pack/plugins/global_search_bar/jest.config.js index 73cf5402a83a93..e00903df125c91 100644 --- a/x-pack/plugins/global_search_bar/jest.config.js +++ b/x-pack/plugins/global_search_bar/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/global_search_bar'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/global_search_bar', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/global_search_bar/public/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/global_search_providers/jest.config.js b/x-pack/plugins/global_search_providers/jest.config.js index b45fb5cdaa4016..231b444585b038 100644 --- a/x-pack/plugins/global_search_providers/jest.config.js +++ b/x-pack/plugins/global_search_providers/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/global_search_providers'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/global_search_providers', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/global_search_providers/{public,server}/**/*.{ts,tsx}', + ], }; diff --git a/x-pack/plugins/graph/jest.config.js b/x-pack/plugins/graph/jest.config.js index 8a4f3db30b04a1..bd9c9d0938686d 100644 --- a/x-pack/plugins/graph/jest.config.js +++ b/x-pack/plugins/graph/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/graph'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/graph', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/graph/{common,public,server}/**/*.{js,ts,tsx}'], }; diff --git a/x-pack/plugins/grokdebugger/jest.config.js b/x-pack/plugins/grokdebugger/jest.config.js index 3785cec03b4107..56cd0339a7afd0 100644 --- a/x-pack/plugins/grokdebugger/jest.config.js +++ b/x-pack/plugins/grokdebugger/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/grokdebugger'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/grokdebugger', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/grokdebugger/{common,public,server}/**/*.{js,ts,tsx}', + ], }; diff --git a/x-pack/plugins/index_lifecycle_management/jest.config.js b/x-pack/plugins/index_lifecycle_management/jest.config.js index 94bbdbdc71e74d..ec594e214106dc 100644 --- a/x-pack/plugins/index_lifecycle_management/jest.config.js +++ b/x-pack/plugins/index_lifecycle_management/jest.config.js @@ -9,4 +9,10 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/index_lifecycle_management'], + coverageDirectory: + '/target/kibana-coverage/jest/x-pack/plugins/index_lifecycle_management', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/index_lifecycle_management/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/x-pack/plugins/index_management/jest.config.js b/x-pack/plugins/index_management/jest.config.js index 8c7eef134d9bfc..8cd0af1f811470 100644 --- a/x-pack/plugins/index_management/jest.config.js +++ b/x-pack/plugins/index_management/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/index_management'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/index_management', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/index_management/{common,public,server}/**/*.{js,ts,tsx}', + ], }; diff --git a/x-pack/plugins/infra/jest.config.js b/x-pack/plugins/infra/jest.config.js index ccc2f5b693a204..5631bc25a14525 100644 --- a/x-pack/plugins/infra/jest.config.js +++ b/x-pack/plugins/infra/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/infra'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/infra', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/infra/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/ingest_pipelines/jest.config.js b/x-pack/plugins/ingest_pipelines/jest.config.js index ba222886858015..e3e76e54a610df 100644 --- a/x-pack/plugins/ingest_pipelines/jest.config.js +++ b/x-pack/plugins/ingest_pipelines/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/ingest_pipelines'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/ingest_pipelines', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/ingest_pipelines/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/x-pack/plugins/lens/jest.config.js b/x-pack/plugins/lens/jest.config.js index 615e540eaedce2..f1164df4eab86e 100644 --- a/x-pack/plugins/lens/jest.config.js +++ b/x-pack/plugins/lens/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/lens'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/lens', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/lens/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/license_api_guard/jest.config.js b/x-pack/plugins/license_api_guard/jest.config.js index e0f348ceabd854..c6c1bc1bd501ae 100644 --- a/x-pack/plugins/license_api_guard/jest.config.js +++ b/x-pack/plugins/license_api_guard/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/license_api_guard'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/license_api_guard', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/license_api_guard/server/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/license_management/jest.config.js b/x-pack/plugins/license_management/jest.config.js index b0ce5947f3cec7..59634448ee26cd 100644 --- a/x-pack/plugins/license_management/jest.config.js +++ b/x-pack/plugins/license_management/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/license_management'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/license_management', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/license_management/{common,public,server}/**/*.{js,ts,tsx}', + ], }; diff --git a/x-pack/plugins/licensing/jest.config.js b/x-pack/plugins/licensing/jest.config.js index d497f6c7fb05bf..5c5276534ebed7 100644 --- a/x-pack/plugins/licensing/jest.config.js +++ b/x-pack/plugins/licensing/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/licensing'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/licensing', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/licensing/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/lists/jest.config.js b/x-pack/plugins/lists/jest.config.js index c05b17f57cf7e7..cb9832920183ff 100644 --- a/x-pack/plugins/lists/jest.config.js +++ b/x-pack/plugins/lists/jest.config.js @@ -6,6 +6,9 @@ */ module.exports = { + collectCoverageFrom: ['/x-pack/plugins/lists/{common,public,server}/**/*.{ts,tsx}'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/lists', + coverageReporters: ['text', 'html'], preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/lists'], diff --git a/x-pack/plugins/logstash/jest.config.js b/x-pack/plugins/logstash/jest.config.js index 98d7f8ccae9c7f..7296aa46adbb05 100644 --- a/x-pack/plugins/logstash/jest.config.js +++ b/x-pack/plugins/logstash/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/logstash'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/logstash', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/logstash/{common,public,server}/**/*.{js,ts,tsx}', + ], }; diff --git a/x-pack/plugins/maps/jest.config.js b/x-pack/plugins/maps/jest.config.js index 9e620095af8805..c9bd7bf4cd0d4c 100644 --- a/x-pack/plugins/maps/jest.config.js +++ b/x-pack/plugins/maps/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/maps'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/maps', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/maps/{common,public,server}/**/*.{js,ts,tsx}'], }; diff --git a/x-pack/plugins/metrics_entities/jest.config.js b/x-pack/plugins/metrics_entities/jest.config.js index 402532aa44c41a..98a391223cc0f9 100644 --- a/x-pack/plugins/metrics_entities/jest.config.js +++ b/x-pack/plugins/metrics_entities/jest.config.js @@ -6,6 +6,9 @@ */ module.exports = { + collectCoverageFrom: ['/x-pack/plugins/metrics_entities/{common,server}/**/*.{ts,tsx}'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/metrics_entities', + coverageReporters: ['text', 'html'], preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/metrics_entities'], diff --git a/x-pack/plugins/ml/jest.config.js b/x-pack/plugins/ml/jest.config.js index 2d162c1bdcb939..463fb9fb856cb2 100644 --- a/x-pack/plugins/ml/jest.config.js +++ b/x-pack/plugins/ml/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/ml'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/ml', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/ml/{common,public,server}/**/*.{js,ts,tsx}'], }; diff --git a/x-pack/plugins/monitoring/jest.config.js b/x-pack/plugins/monitoring/jest.config.js index 76b32a2409d3a0..772b1ff1e5810c 100644 --- a/x-pack/plugins/monitoring/jest.config.js +++ b/x-pack/plugins/monitoring/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/monitoring'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/monitoring', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/monitoring/{common,public,server}/**/*.{js,ts,tsx}', + ], }; diff --git a/x-pack/plugins/observability/jest.config.js b/x-pack/plugins/observability/jest.config.js index 6fdeab06df0530..39d8067d0efe4e 100644 --- a/x-pack/plugins/observability/jest.config.js +++ b/x-pack/plugins/observability/jest.config.js @@ -10,4 +10,9 @@ module.exports = { rootDir: '../../..', roots: ['/x-pack/plugins/observability'], setupFiles: ['/x-pack/plugins/observability/.storybook/jest_setup.js'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/observability', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/observability/{common,public,server}/**/*.{js,ts,tsx}', + ], }; diff --git a/x-pack/plugins/osquery/jest.config.js b/x-pack/plugins/osquery/jest.config.js index 7158ccc51aaf9a..ea070e615b6bca 100644 --- a/x-pack/plugins/osquery/jest.config.js +++ b/x-pack/plugins/osquery/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/osquery'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/osquery', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/osquery/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/painless_lab/jest.config.js b/x-pack/plugins/painless_lab/jest.config.js index 2ca58ad18fc2db..364e9e5a08fa4b 100644 --- a/x-pack/plugins/painless_lab/jest.config.js +++ b/x-pack/plugins/painless_lab/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/painless_lab'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/painless_lab', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/painless_lab/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/x-pack/plugins/remote_clusters/jest.config.js b/x-pack/plugins/remote_clusters/jest.config.js index 50c5195cdc16aa..3467ea1d5b4059 100644 --- a/x-pack/plugins/remote_clusters/jest.config.js +++ b/x-pack/plugins/remote_clusters/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/remote_clusters'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/remote_clusters', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/remote_clusters/{common,public,server}/**/*.{js,ts,tsx}', + ], }; diff --git a/x-pack/plugins/reporting/jest.config.js b/x-pack/plugins/reporting/jest.config.js index 1968c565934a9c..4354377fc26cdd 100644 --- a/x-pack/plugins/reporting/jest.config.js +++ b/x-pack/plugins/reporting/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/reporting'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/reporting', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/reporting/{common,public,server}/**/*.{js,ts,tsx}', + ], }; diff --git a/x-pack/plugins/rollup/jest.config.js b/x-pack/plugins/rollup/jest.config.js index 5566868f659528..937ff3524f9d64 100644 --- a/x-pack/plugins/rollup/jest.config.js +++ b/x-pack/plugins/rollup/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/rollup'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/rollup', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/rollup/{common,public,server}/**/*.{js,ts,tsx}'], }; diff --git a/x-pack/plugins/rule_registry/jest.config.js b/x-pack/plugins/rule_registry/jest.config.js index df8ac522e4b5de..463204b32e29ff 100644 --- a/x-pack/plugins/rule_registry/jest.config.js +++ b/x-pack/plugins/rule_registry/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/rule_registry'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/rule_registry', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/rule_registry/{common,server}/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/runtime_fields/jest.config.js b/x-pack/plugins/runtime_fields/jest.config.js index 5c4b71d99224b7..3af90818280cfa 100644 --- a/x-pack/plugins/runtime_fields/jest.config.js +++ b/x-pack/plugins/runtime_fields/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/runtime_fields'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/runtime_fields', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/runtime_fields/public/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/saved_objects_tagging/jest.config.js b/x-pack/plugins/saved_objects_tagging/jest.config.js index a2bf58c4c30028..2a2d0371267e37 100644 --- a/x-pack/plugins/saved_objects_tagging/jest.config.js +++ b/x-pack/plugins/saved_objects_tagging/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/saved_objects_tagging'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/saved_objects_tagging', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/saved_objects_tagging/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/x-pack/plugins/searchprofiler/jest.config.js b/x-pack/plugins/searchprofiler/jest.config.js index e6f3cd3744f18e..3071f75c18d968 100644 --- a/x-pack/plugins/searchprofiler/jest.config.js +++ b/x-pack/plugins/searchprofiler/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/searchprofiler'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/searchprofiler', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/searchprofiler/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/x-pack/plugins/security/jest.config.js b/x-pack/plugins/security/jest.config.js index e31b17583ffcaa..bc9a651eb78bfe 100644 --- a/x-pack/plugins/security/jest.config.js +++ b/x-pack/plugins/security/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/security'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/security', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/security/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/security_solution/jest.config.js b/x-pack/plugins/security_solution/jest.config.js index 700eaebf6c2023..6cfcb65bb5d685 100644 --- a/x-pack/plugins/security_solution/jest.config.js +++ b/x-pack/plugins/security_solution/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/security_solution'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/security_solution', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/security_solution/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/x-pack/plugins/snapshot_restore/jest.config.js b/x-pack/plugins/snapshot_restore/jest.config.js index f1c9213047ad5a..b7dbd6f6c5786e 100644 --- a/x-pack/plugins/snapshot_restore/jest.config.js +++ b/x-pack/plugins/snapshot_restore/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/snapshot_restore'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/snapshot_restore', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/snapshot_restore/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/x-pack/plugins/spaces/jest.config.js b/x-pack/plugins/spaces/jest.config.js index 4629d714d6d693..791f82af86ce09 100644 --- a/x-pack/plugins/spaces/jest.config.js +++ b/x-pack/plugins/spaces/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/spaces'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/spaces', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/spaces/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/stack_alerts/jest.config.js b/x-pack/plugins/stack_alerts/jest.config.js index 3d03438e02c09e..f2f53fd9e00505 100644 --- a/x-pack/plugins/stack_alerts/jest.config.js +++ b/x-pack/plugins/stack_alerts/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/stack_alerts'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/stack_alerts', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/stack_alerts/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/x-pack/plugins/task_manager/jest.config.js b/x-pack/plugins/task_manager/jest.config.js index 49293eb21153a6..416709552bd374 100644 --- a/x-pack/plugins/task_manager/jest.config.js +++ b/x-pack/plugins/task_manager/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/task_manager'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/task_manager', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/task_manager/server/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/telemetry_collection_xpack/jest.config.js b/x-pack/plugins/telemetry_collection_xpack/jest.config.js index 1f8e83ab2d86e0..94f0906c2149e8 100644 --- a/x-pack/plugins/telemetry_collection_xpack/jest.config.js +++ b/x-pack/plugins/telemetry_collection_xpack/jest.config.js @@ -9,4 +9,8 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/telemetry_collection_xpack'], + coverageDirectory: + '/target/kibana-coverage/jest/x-pack/plugins/telemetry_collection_xpack', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/telemetry_collection_xpack/server/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/timelines/jest.config.js b/x-pack/plugins/timelines/jest.config.js index 12bc67dbb2f07b..d26134d924e1d3 100644 --- a/x-pack/plugins/timelines/jest.config.js +++ b/x-pack/plugins/timelines/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/timelines'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/timelines', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/timelines/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/transform/jest.config.js b/x-pack/plugins/transform/jest.config.js index 6b6a57d433392c..2732cd66e2c940 100644 --- a/x-pack/plugins/transform/jest.config.js +++ b/x-pack/plugins/transform/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/transform'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/transform', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/transform/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/triggers_actions_ui/jest.config.js b/x-pack/plugins/triggers_actions_ui/jest.config.js index 38bced1dafb43f..f6369b6b2b97e3 100644 --- a/x-pack/plugins/triggers_actions_ui/jest.config.js +++ b/x-pack/plugins/triggers_actions_ui/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/triggers_actions_ui'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/triggers_actions_ui', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/triggers_actions_ui/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/x-pack/plugins/ui_actions_enhanced/jest.config.js b/x-pack/plugins/ui_actions_enhanced/jest.config.js index dd27310084e0dc..8182b23b2ebe9b 100644 --- a/x-pack/plugins/ui_actions_enhanced/jest.config.js +++ b/x-pack/plugins/ui_actions_enhanced/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/ui_actions_enhanced'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/ui_actions_enhanced', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/ui_actions_enhanced/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/x-pack/plugins/upgrade_assistant/jest.config.js b/x-pack/plugins/upgrade_assistant/jest.config.js index 65043acd878da0..024cb4a49ab3dd 100644 --- a/x-pack/plugins/upgrade_assistant/jest.config.js +++ b/x-pack/plugins/upgrade_assistant/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/upgrade_assistant'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/upgrade_assistant', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/upgrade_assistant/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/x-pack/plugins/uptime/jest.config.js b/x-pack/plugins/uptime/jest.config.js index 9e97154843770a..baafb5ce133e64 100644 --- a/x-pack/plugins/uptime/jest.config.js +++ b/x-pack/plugins/uptime/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/uptime'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/uptime', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/uptime/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/watcher/jest.config.js b/x-pack/plugins/watcher/jest.config.js index d5189ae9206378..b078f2ab665d75 100644 --- a/x-pack/plugins/watcher/jest.config.js +++ b/x-pack/plugins/watcher/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/watcher'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/watcher', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/watcher/{common,public,server}/**/*.{js,ts,tsx}'], }; diff --git a/x-pack/plugins/xpack_legacy/jest.config.js b/x-pack/plugins/xpack_legacy/jest.config.js index 98d2dd0aa824c5..5ad0fa36264d1c 100644 --- a/x-pack/plugins/xpack_legacy/jest.config.js +++ b/x-pack/plugins/xpack_legacy/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/xpack_legacy'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/xpack_legacy', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/xpack_legacy/server/**/*.{ts,tsx}'], };