Skip to content

Commit

Permalink
[Fleet] Split jest config public|common|server (elastic#205798)
Browse files Browse the repository at this point in the history
(cherry picked from commit 8bb2da1)
  • Loading branch information
nchaulet committed Jan 10, 2025
1 parent ac4699b commit 5aeed97
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 5aeed97

Please sign in to comment.