Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kbn-test] Jest run script should use testPathPattern to lookup config #206341

Merged
merged 2 commits into from
Jan 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/kbn-test/src/jest/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ export function runJest(configName = 'jest.config.js') {

if (!argv.config) {
testFiles = argv._.map((p) => resolve(cwd, p.toString()));

if (argv.testPathPattern) {
testFiles.push(argv.testPathPattern);
}

const commonTestFiles = commonBasePath(testFiles);
const testFilesProvided = testFiles.length > 0;

Expand Down Expand Up @@ -123,7 +128,7 @@ export function runJest(configName = 'jest.config.js') {
);
} else {
log.error(
`we no longer ship a root config file so you either need to pass a path to a test file, a folder where tests can be found, or a --config argument pointing to one of the many ${configName} files in the repository`
`we no longer ship a root config file so you either need to pass a path to a test file, a folder where tests can be found, a --testPathPattern argument pointing to a file/directory or a --config argument pointing to one of the many ${configName} files in the repository`
);
}

Expand Down
Loading