diff --git a/packages/core/cli/src/commands/e2e.js b/packages/core/cli/src/commands/e2e.js index 361687b9b..8d70f553a 100644 --- a/packages/core/cli/src/commands/e2e.js +++ b/packages/core/cli/src/commands/e2e.js @@ -243,6 +243,12 @@ module.exports = (cli) => { .option('--stop-on-error') .option('--build') .option('--concurrency [concurrency]', '', os.cpus().length) + .option( + '--match [match]', + 'Only the files matching one of these patterns are executed as test files. Matching is performed against the absolute file path. Strings are treated as glob patterns.', + 'packages/**/__e2e__/**/*.test.ts', + ) + .option('--ignore [ignore]', 'Skip tests that match the pattern. Strings are treated as glob patterns.', undefined) .action(async (options) => { process.env.__E2E__ = true; if (options.build) { diff --git a/packages/core/cli/src/commands/p-test.js b/packages/core/cli/src/commands/p-test.js index 05bcaa06e..fb5b8a828 100644 --- a/packages/core/cli/src/commands/p-test.js +++ b/packages/core/cli/src/commands/p-test.js @@ -60,7 +60,8 @@ exports.pTest = async (options) => { fs.mkdirSync(dir, { recursive: true }); } - const files = glob.sync('packages/**/__e2e__/**/*.test.ts', { + const files = glob.sync(options.match, { + ignore: options.ignore, root: process.cwd(), });