fix(react): component test regex should not use global (#17548)

This commit is contained in:
Colum Ferry 2023-06-14 16:27:19 +01:00 committed by GitHub
parent 73ab23f381
commit 76b7d61592
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,8 +11,8 @@ import { getComponentNode } from './ast-utils';
let tsModule: typeof import('typescript');
const allowedFileExt = new RegExp(/\.[jt]sx?/g);
const isSpecFile = new RegExp(/(spec|test)\./g);
const allowedFileExt = new RegExp(/\.[jt]sx?/);
const isSpecFile = new RegExp(/(spec|test)\./);
export interface FoundTarget {
config?: TargetConfiguration;
@ -56,6 +56,7 @@ function assertValidConfig(config: unknown) {
);
}
}
export async function getBundlerFromTarget(
found: FoundTarget,
tree: Tree