chore: add options for matching and ignoring test files in e2e and p-test commands (#3811)
This commit is contained in:
parent
5e22103e33
commit
f2828cd8b0
@ -243,6 +243,12 @@ module.exports = (cli) => {
|
|||||||
.option('--stop-on-error')
|
.option('--stop-on-error')
|
||||||
.option('--build')
|
.option('--build')
|
||||||
.option('--concurrency [concurrency]', '', os.cpus().length)
|
.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) => {
|
.action(async (options) => {
|
||||||
process.env.__E2E__ = true;
|
process.env.__E2E__ = true;
|
||||||
if (options.build) {
|
if (options.build) {
|
||||||
|
@ -60,7 +60,8 @@ exports.pTest = async (options) => {
|
|||||||
fs.mkdirSync(dir, { recursive: true });
|
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(),
|
root: process.cwd(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user