Skip to content

Commit

Permalink
Add changedSince to allowed watchmode configs (#6955)
Browse files Browse the repository at this point in the history
  • Loading branch information
rickhanlonii authored and SimenB committed Sep 9, 2018
1 parent 38f445a commit 19ceeb5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
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

0 comments on commit 19ceeb5

Please sign in to comment.