Skip to content

Commit

Permalink
[8.x] [Fleet] Split jest config public|common|server (#205798) (#206301)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to `8.x`:
- [[Fleet] Split jest config public|common|server
(#205798)](#205798)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Nicolas
Chaulet","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-10T15:44:06Z","message":"[Fleet]
Split jest config public|common|server
(#205798)","sha":"8bb2da19ea4e22d279df355f620790080548da00","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v9.0.0","backport:prev-minor"],"title":"[Fleet]
Split jest config
public|common|server","number":205798,"url":"https://github.com/elastic/kibana/pull/205798","mergeCommit":{"message":"[Fleet]
Split jest config public|common|server
(#205798)","sha":"8bb2da19ea4e22d279df355f620790080548da00"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/205798","number":205798,"mergeCommit":{"message":"[Fleet]
Split jest config public|common|server
(#205798)","sha":"8bb2da19ea4e22d279df355f620790080548da00"}}]}]
BACKPORT-->

Co-authored-by: Nicolas Chaulet <[email protected]>
  • Loading branch information
kibanamachine and nchaulet authored Jan 10, 2025
1 parent 7cc634c commit 6374b69
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@

module.exports = {
preset: '@kbn/test',
rootDir: '../../../../..',
roots: ['<rootDir>/x-pack/platform/plugins/shared/fleet'],
rootDir: '../../../../../..',
roots: ['<rootDir>/x-pack/platform/plugins/shared/fleet/common'],
transform: {
'^.+\\.stories\\.tsx?$': '@storybook/addon-storyshots/injectFileName',
},
coverageDirectory: '<rootDir>/target/kibana-coverage/jest/x-pack/platform/plugins/shared/fleet',
coverageDirectory:
'<rootDir>/target/kibana-coverage/jest/x-pack/platform/plugins/shared/fleet/common',
coverageReporters: ['text', 'html'],
collectCoverageFrom: [
'<rootDir>/x-pack/platform/plugins/shared/fleet/{common,public,server}/**/*.{ts,tsx}',
],
collectCoverageFrom: ['<rootDir>/x-pack/platform/plugins/shared/fleet/common/**/*.{ts,tsx}'],
};
17 changes: 17 additions & 0 deletions x-pack/platform/plugins/shared/fleet/jest.config.dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* 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.
*/

module.exports = {
preset: '@kbn/test/jest',
rootDir: '../../../../..',
roots: ['<rootDir>/x-pack/platform/plugins/shared/fleet'],
projects: [
'<rootDir>/x-pack/platform/plugins/shared/fleet/common/*/jest.config.js',
'<rootDir>/x-pack/platform/plugins/shared/fleet/server/*/jest.config.js',
'<rootDir>/x-pack/platform/plugins/shared/fleet/public/*/jest.config.js',
],
};
19 changes: 19 additions & 0 deletions x-pack/platform/plugins/shared/fleet/public/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* 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.
*/

module.exports = {
preset: '@kbn/test',
rootDir: '../../../../../..',
roots: ['<rootDir>/x-pack/platform/plugins/shared/fleet/public'],
transform: {
'^.+\\.stories\\.tsx?$': '@storybook/addon-storyshots/injectFileName',
},
coverageDirectory:
'<rootDir>/target/kibana-coverage/jest/x-pack/platform/plugins/shared/fleet/public',
coverageReporters: ['text', 'html'],
collectCoverageFrom: ['<rootDir>/x-pack/platform/plugins/shared/fleet/public/**/*.{ts,tsx}'],
};
19 changes: 19 additions & 0 deletions x-pack/platform/plugins/shared/fleet/scripts/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* 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.
*/

module.exports = {
preset: '@kbn/test',
rootDir: '../../../../../..',
roots: ['<rootDir>/x-pack/platform/plugins/shared/fleet/scripts'],
transform: {
'^.+\\.stories\\.tsx?$': '@storybook/addon-storyshots/injectFileName',
},
coverageDirectory:
'<rootDir>/target/kibana-coverage/jest/x-pack/platform/plugins/shared/fleet/scripts',
coverageReporters: ['text', 'html'],
collectCoverageFrom: ['<rootDir>/x-pack/platform/plugins/shared/fleet/scripts/**/*.{ts,tsx}'],
};
16 changes: 16 additions & 0 deletions x-pack/platform/plugins/shared/fleet/server/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* 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.
*/

module.exports = {
preset: '@kbn/test',
rootDir: '../../../../../..',
roots: ['<rootDir>/x-pack/platform/plugins/shared/fleet/server'],
coverageDirectory:
'<rootDir>/target/kibana-coverage/jest/x-pack/platform/plugins/shared/fleet/server',
coverageReporters: ['text', 'html'],
collectCoverageFrom: ['<rootDir>/x-pack/platform/plugins/shared/fleet/{server}/**/*.{ts,tsx}'],
};

0 comments on commit 6374b69

Please sign in to comment.