diff --git a/common/changes/@rushstack/heft-jest-plugin/fix-heft-jest-test-path-pattern_2026-06-09-03-35.json b/common/changes/@rushstack/heft-jest-plugin/fix-heft-jest-test-path-pattern_2026-06-09-03-35.json new file mode 100644 index 0000000000..1f3c2c0b50 --- /dev/null +++ b/common/changes/@rushstack/heft-jest-plugin/fix-heft-jest-test-path-pattern_2026-06-09-03-35.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "packageName": "@rushstack/heft-jest-plugin", + "comment": "Fix an issue where the `--test-path-pattern` parameter was ignored, causing all tests to run. In Jest 30 the `Config.Argv` field was renamed from `testPathPattern` to `testPathPatterns`.", + "type": "patch" + } + ], + "packageName": "@rushstack/heft-jest-plugin", + "email": "iclanton@users.noreply.github.com" +} diff --git a/heft-plugins/heft-jest-plugin/src/JestPlugin.ts b/heft-plugins/heft-jest-plugin/src/JestPlugin.ts index d433cbceb4..f33e55079d 100644 --- a/heft-plugins/heft-jest-plugin/src/JestPlugin.ts +++ b/heft-plugins/heft-jest-plugin/src/JestPlugin.ts @@ -627,7 +627,7 @@ export default class JestPlugin implements IHeftTaskPlugin { testNamePattern: options.testNamePattern, testPathIgnorePatterns: options.testPathIgnorePatterns ? [options.testPathIgnorePatterns] : undefined, - testPathPattern: options.testPathPattern ? [options.testPathPattern] : undefined, + testPathPatterns: options.testPathPattern ? [options.testPathPattern] : undefined, testTimeout: options.testTimeout, maxWorkers: options.maxWorkers,