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

Add changedSince to allowed watchmode configs #6955

Merged
merged 2 commits into from
Sep 9, 2018
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### Features

- `[jest-ci]` Add `changedSince` to allowed watch mode configs ([#6955](https://github.com/facebook/jest/pull/6955))
- `[babel-jest]` Add support for `babel.config.js` added in Babel 7.0.0 ([#6911](https://github.com/facebook/jest/pull/6911))

### Fixes
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-cli/src/__tests__/watch.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ describe('Watch mode flows', () => {
ok | option
${'✔︎'} | ${'bail'}
${'✖︎'} | ${'changedFilesWithAncestor'}
${'︎'} | ${'changedSince'}
${'︎'} | ${'changedSince'}
${'✔︎'} | ${'collectCoverage'}
${'✔︎'} | ${'collectCoverageFrom'}
${'✔︎'} | ${'collectCoverageOnlyFrom'}
Expand Down
5 changes: 5 additions & 0 deletions packages/jest-cli/src/lib/update_global_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import type {GlobalConfig} from 'types/Config';

export type Options = {
bail?: $PropertyType<GlobalConfig, 'bail'>,
changedSince?: $PropertyType<GlobalConfig, 'changedSince'>,
collectCoverage?: $PropertyType<GlobalConfig, 'collectCoverage'>,
collectCoverageFrom?: $PropertyType<GlobalConfig, 'collectCoverageFrom'>,
collectCoverageOnlyFrom?: $PropertyType<
Expand Down Expand Up @@ -69,6 +70,10 @@ export default (globalConfig: GlobalConfig, options: Options): GlobalConfig => {
newConfig.bail = options.bail || false;
}

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

if (options.collectCoverage !== undefined) {
newConfig.collectCoverage = options.collectCoverage || false;
}
Expand Down
2 changes: 2 additions & 0 deletions packages/jest-cli/src/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export default function watch(

const updateConfigAndRun = ({
bail,
changedSince,
collectCoverage,
collectCoverageFrom,
collectCoverageOnlyFrom,
Expand All @@ -100,6 +101,7 @@ export default function watch(
const previousUpdateSnapshot = globalConfig.updateSnapshot;
globalConfig = updateGlobalConfig(globalConfig, {
bail,
changedSince,
collectCoverage,
collectCoverageFrom,
collectCoverageOnlyFrom,
Expand Down