Skip to content

Commit 3184685

Browse files
author
chengyu.chengyulia
committed
feat: run test support testRegex
1 parent 84eebd5 commit 3184685

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

src/built-in-plugins/command-test/plugin/interface.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ export type IOpts = Arguments<{
55
updateSnapshot?: boolean;
66
watch?: boolean;
77
watchAll?: boolean;
8+
testRegex?: string | string[];
89
}>;

src/built-in-plugins/command-test/plugin/run-test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { IOpts } from './interface';
1010
export const runTest = async (options: IOpts) => {
1111
const jestConfig = {
1212
rootDir: pri.sourceRoot,
13-
testRegex: `${path.join(pri.sourceRoot, testsPath.dir)}/.*\\.tsx?$`,
13+
testRegex: options.testRegex ?? `${path.join(pri.sourceRoot, testsPath.dir)}/.*\\.tsx?$`,
1414
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
1515
coverage: true,
1616
updateSnapshot: options.updateSnapshot,

0 commit comments

Comments
 (0)