mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[jest/configs] fix checks for nested packages (#130583)
This commit is contained in:
parent
2a7b219fbb
commit
1264fc9203
3 changed files with 3 additions and 15 deletions
|
@ -19,7 +19,7 @@ import { REPO_ROOT } from '@kbn/utils';
|
|||
* eg. src/vis_editors => would find a package at src/vis_editors/foo/package.json
|
||||
* src/vis_editors/* => would find a package at src/vis_editors/foo/bar/package.json
|
||||
*/
|
||||
export const BAZEL_PACKAGE_DIRS = ['packages', 'packages/shared-ux', 'packages/shared-ux/*'];
|
||||
export const BAZEL_PACKAGE_DIRS = ['packages', 'packages/shared-ux/*'];
|
||||
|
||||
/**
|
||||
* Resolve all the BAZEL_PACKAGE_DIRS to absolute paths
|
||||
|
|
|
@ -24,7 +24,8 @@ export class JestConfigs {
|
|||
|
||||
constructor(cwd: string, roots: string[]) {
|
||||
this.cwd = cwd;
|
||||
this.roots = roots;
|
||||
// sort roots by length so when we use `file.startsWith()` we will find the most specific root first
|
||||
this.roots = roots.slice().sort((a, b) => b.length - a.length);
|
||||
}
|
||||
|
||||
async files(type: 'unit' | 'integration') {
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
/*
|
||||
* 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 and the Server Side Public License, v 1; you may not use this file except
|
||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
preset: '@kbn/test',
|
||||
rootDir: '../..',
|
||||
roots: ['<rootDir>/packages/shared-ux'],
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue