fix(testing): fix generated testMatch pattern in jest config to support windows (#15415)

This commit is contained in:
Leosvel Pérez Espinosa 2023-03-03 18:30:32 +00:00 committed by GitHub
parent 95c832ae91
commit 5e12d053a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 5 deletions

View File

@ -22,6 +22,6 @@
]<% } %><% if(rootProject){ %>,
testMatch: [
'<rootDir>/src/**/__tests__/**/*.[jt]s?(x)',
'<rootDir>/src/**/?(*.)+(spec|test).[jt]s?(x)',
'<rootDir>/src/**/*(*.)@(spec|test).[jt]s?(x)',
],<% } %>
};

View File

@ -11,6 +11,6 @@
coverageDirectory: '<%= offsetFromRoot %>coverage/<%= projectRoot %>'<% if(rootProject){ %>,
testMatch: [
'<rootDir>/src/**/__tests__/**/*.[jt]s?(x)',
'<rootDir>/src/**/?(*.)+(spec|test).[jt]s?(x)',
'<rootDir>/src/**/*(*.)@(spec|test).[jt]s?(x)',
],<% } %>
};

View File

@ -388,7 +388,7 @@ describe('jestProject', () => {
coverageDirectory: './coverage/my-project',
testMatch: [
'<rootDir>/src/**/__tests__/**/*.[jt]s?(x)',
'<rootDir>/src/**/?(*.)+(spec|test).[jt]s?(x)',
'<rootDir>/src/**/*(*.)@(spec|test).[jt]s?(x)',
],
};
"
@ -421,7 +421,7 @@ describe('jestProject', () => {
coverageDirectory: './coverage/my-project',
testMatch: [
'<rootDir>/src/**/__tests__/**/*.[jt]s?(x)',
'<rootDir>/src/**/?(*.)+(spec|test).[jt]s?(x)',
'<rootDir>/src/**/*(*.)@(spec|test).[jt]s?(x)',
],
};
"

View File

@ -281,7 +281,7 @@ function getJestOptions(
delete jestOptions['testRegex'];
jestOptions['testMatch'] = isE2E
? ['<rootDir>/test/**/?(*.)+(e2e-spec|e2e-test).[jt]s?(x)']
: ['<rootDir>/src/**/?(*.)+(spec|test).[jt]s?(x)'];
: ['<rootDir>/src/**/*(*.)@(spec|test).[jt]s?(x)'];
// set coverage directory for unit test
if (!isE2E) {