Allow to pass `findRelatedTests` and `nonFlagArgs` to `updateConfigAndRun` (#10659)

This commit is contained in:
Alex 2020-10-23 19:38:39 +05:00 committed by GitHub
parent 9b9020b2f3
commit 1535af7659
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 2 deletions

View File

@ -2,6 +2,8 @@
### Features
- `[jest-core]` Add `findRelatedTests` and `nonFlagArgs` in allowed config options for `updateConfigAndRun` in watch plugins ([#10659](https://github.com/facebook/jest/pull/10659))
### Fixes
### Chore & Maintenance

View File

@ -617,7 +617,7 @@ describe('Watch mode flows', () => {
${'✖︎'} | ${'errorOnDeprecated'}
${'✖︎'} | ${'expand'}
${'✖︎'} | ${'filter'}
${''} | ${'findRelatedTests'}
${''} | ${'findRelatedTests'}
${'✖︎'} | ${'forceExit'}
${'✖︎'} | ${'globalSetup'}
${'✖︎'} | ${'globalTeardown'}
@ -626,7 +626,7 @@ describe('Watch mode flows', () => {
${'✖︎'} | ${'listTests'}
${'✖︎'} | ${'logHeapUsage'}
${'✖︎'} | ${'maxWorkers'}
${''} | ${'nonFlagArgs'}
${''} | ${'nonFlagArgs'}
${'✖︎'} | ${'noSCM'}
${'✖︎'} | ${'noStackTrace'}
${'✔︎'} | ${'notify'}

View File

@ -72,6 +72,14 @@ export default (
newConfig.coverageReporters = options.coverageReporters;
}
if (options.findRelatedTests !== undefined) {
newConfig.findRelatedTests = options.findRelatedTests;
}
if (options.nonFlagArgs !== undefined) {
newConfig.nonFlagArgs = options.nonFlagArgs;
}
if (options.noSCM) {
newConfig.noSCM = true;
}

View File

@ -107,7 +107,9 @@ export default function watch(
collectCoverageOnlyFrom,
coverageDirectory,
coverageReporters,
findRelatedTests,
mode,
nonFlagArgs,
notify,
notifyMode,
onlyFailures,
@ -126,7 +128,9 @@ export default function watch(
collectCoverageOnlyFrom,
coverageDirectory,
coverageReporters,
findRelatedTests,
mode,
nonFlagArgs,
notify,
notifyMode,
onlyFailures,

View File

@ -56,6 +56,8 @@ export type AllowedConfigOptions = Partial<
| 'collectCoverageOnlyFrom'
| 'coverageDirectory'
| 'coverageReporters'
| 'findRelatedTests'
| 'nonFlagArgs'
| 'notify'
| 'notifyMode'
| 'onlyFailures'