Skip to content

Commit

Permalink
exclude x-pack/test from roots
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Dec 2, 2021
1 parent de1fe46 commit e690ab4
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion jest.config.integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,22 @@
* Side Public License, v 1.
*/

const Fs = require('fs');
const Path = require('path');

module.exports = {
preset: '@kbn/test/jest_integration',
rootDir: '.',
roots: ['<rootDir>/src', '<rootDir>/packages', '<rootDir>/x-pack'],
roots: [
'<rootDir>/src',
'<rootDir>/packages',
...Fs.readdirSync(Path.resolve(__dirname, 'x-pack')).flatMap((name) => {
// create roots for all x-pack/* dirs except for test
if (name !== 'test' && Fs.statSync(Path.resolve(__dirname, 'x-pack', name)).isDirectory()) {
return [`<rootDir>/x-pack/${name}`];
}

return [];
}),
],
};

0 comments on commit e690ab4

Please sign in to comment.