[Fleet] Split jest config public|common|server (#205798)

This commit is contained in:
Nicolas Chaulet 2025-01-10 10:44:06 -05:00 committed by GitHub
parent ac4577159e
commit 8bb2da19ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 76 additions and 6 deletions

View file

@ -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}'],
};

View file

@ -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',
],
};

View file

@ -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}'],
};

View file

@ -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}'],
};

View file

@ -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}'],
};