feat(testing): add --testPathIgnorePatterns flag support (#7478)

closes #7462

Co-authored-by: Matt <MattGson>
This commit is contained in:
Matt 2021-11-09 07:42:44 +13:00 committed by GitHub
parent 36a81b7c04
commit 965b11679f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 29 additions and 0 deletions

View File

@ -176,6 +176,12 @@ Type: `string`
Run only tests with a name that matches the regex pattern. (https://jestjs.io/docs/cli#--testnamepatternregex)
### testPathIgnorePatterns
Type: `array`
An array of regexp pattern strings that is matched against all tests paths before executing the test. Only run those tests with a path that does not match with the provided regexp expressions. (https://jestjs.io/docs/cli#--testpathignorepatternsregexarray)
### testPathPattern
Type: `array`

View File

@ -176,6 +176,12 @@ Type: `string`
Run only tests with a name that matches the regex pattern. (https://jestjs.io/docs/cli#--testnamepatternregex)
### testPathIgnorePatterns
Type: `array`
An array of regexp pattern strings that is matched against all tests paths before executing the test. Only run those tests with a path that does not match with the provided regexp expressions. (https://jestjs.io/docs/cli#--testpathignorepatternsregexarray)
### testPathPattern
Type: `array`

View File

@ -176,6 +176,12 @@ Type: `string`
Run only tests with a name that matches the regex pattern. (https://jestjs.io/docs/cli#--testnamepatternregex)
### testPathIgnorePatterns
Type: `array`
An array of regexp pattern strings that is matched against all tests paths before executing the test. Only run those tests with a path that does not match with the provided regexp expressions. (https://jestjs.io/docs/cli#--testpathignorepatternsregexarray)
### testPathPattern
Type: `array`

View File

@ -181,6 +181,7 @@ describe('Jest Executor', () => {
showConfig: true,
silent: true,
testNamePattern: 'test',
testPathIgnorePatterns: ['/test/path/|/tests/e2e/'],
testPathPattern: ['/test/path'],
colors: false,
reporters: ['/test/path'],
@ -212,6 +213,7 @@ describe('Jest Executor', () => {
showConfig: true,
silent: true,
testNamePattern: 'test',
testPathIgnorePatterns: ['/test/path/|/tests/e2e/'],
testPathPattern: ['/test/path'],
colors: false,
verbose: false,

View File

@ -57,6 +57,7 @@ export async function jestConfigParser(
testLocationInResults: options.testLocationInResults,
testNamePattern: options.testNamePattern,
testPathPattern: options.testPathPattern,
testPathIgnorePatterns: options.testPathIgnorePatterns,
testTimeout: options.testTimeout,
colors: options.colors,
verbose: options.verbose,

View File

@ -20,6 +20,7 @@ export interface JestExecutorOptions {
showConfig?: boolean;
silent?: boolean;
testNamePattern?: string;
testPathIgnorePatterns?: string[];
testPathPattern?: string[];
colors?: boolean;
reporters?: string[];

View File

@ -101,6 +101,13 @@
"description": "Run only tests with a name that matches the regex pattern. (https://jestjs.io/docs/cli#--testnamepatternregex)",
"type": "string"
},
"testPathIgnorePatterns": {
"description": "An array of regexp pattern strings that is matched against all tests paths before executing the test. Only run those tests with a path that does not match with the provided regexp expressions. (https://jestjs.io/docs/cli#--testpathignorepatternsregexarray)",
"type": "array",
"items": {
"type": "string"
}
},
"testPathPattern": {
"description": "An array of regexp pattern strings that is matched against all tests paths before executing the test. (https://jestjs.io/docs/cli#--testpathpatternregex)",
"type": "array",