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

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/jest-core/src/__tests__/watch.test.js
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
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
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
Expand Up @@ -56,6 +56,8 @@ export type AllowedConfigOptions = Partial<
| 'collectCoverageOnlyFrom'
| 'coverageDirectory'
| 'coverageReporters'
| 'findRelatedTests'
| 'nonFlagArgs'
| 'notify'
| 'notifyMode'
| 'onlyFailures'
Expand Down