Skip to content
New issue

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

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

Already on GitHub? # to your account

Allow to pass findRelatedTests and nonFlagArgs to updateConfigAndRun #10659

Merged
merged 4 commits into from
Oct 23, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions packages/jest-core/src/__tests__/watch.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ describe('Watch mode flows', () => {
${'✖︎'} | ${'errorOnDeprecated'}
${'✖︎'} | ${'expand'}
${'✖︎'} | ${'filter'}
${'︎'} | ${'findRelatedTests'}
${'︎'} | ${'findRelatedTests'}
${'✖︎'} | ${'forceExit'}
${'✖︎'} | ${'globalSetup'}
${'✖︎'} | ${'globalTeardown'}
Expand All @@ -626,7 +626,7 @@ describe('Watch mode flows', () => {
${'✖︎'} | ${'listTests'}
${'✖︎'} | ${'logHeapUsage'}
${'✖︎'} | ${'maxWorkers'}
${'︎'} | ${'nonFlagArgs'}
${'︎'} | ${'nonFlagArgs'}
${'✖︎'} | ${'noSCM'}
${'✖︎'} | ${'noStackTrace'}
${'✔︎'} | ${'notify'}
Expand Down
8 changes: 6 additions & 2 deletions packages/jest-core/src/lib/update_global_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,12 @@ export default (
newConfig.coverageDirectory = options.coverageDirectory;
}

if (options.coverageReporters !== undefined) {
newConfig.coverageReporters = options.coverageReporters;
SimenB marked this conversation as resolved.
Show resolved Hide resolved
if (options.findRelatedTests !== undefined) {
newConfig.findRelatedTests = options.findRelatedTests;
}

if (options.nonFlagArgs !== undefined) {
newConfig.nonFlagArgs = options.nonFlagArgs;
}

if (options.noSCM) {
Expand Down
4 changes: 4 additions & 0 deletions packages/jest-core/src/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ export default function watch(
collectCoverageOnlyFrom,
coverageDirectory,
coverageReporters,
findRelatedTests,
mode,
nonFlagArgs,
notify,
notifyMode,
onlyFailures,
Expand All @@ -126,7 +128,9 @@ export default function watch(
collectCoverageOnlyFrom,
coverageDirectory,
coverageReporters,
findRelatedTests,
mode,
nonFlagArgs,
notify,
notifyMode,
onlyFailures,
Expand Down
2 changes: 2 additions & 0 deletions packages/jest-watcher/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ export type AllowedConfigOptions = Partial<
| 'collectCoverageOnlyFrom'
| 'coverageDirectory'
| 'coverageReporters'
| 'findRelatedTests'
| 'nonFlagArgs'
| 'notify'
| 'notifyMode'
| 'onlyFailures'
Expand Down