Skip to content

Commit

Permalink
Change watch mode UX.
Browse files Browse the repository at this point in the history
  • Loading branch information
cpojer committed Sep 22, 2017
1 parent 7754a77 commit f92c3be
Show file tree
Hide file tree
Showing 18 changed files with 24 additions and 1,042 deletions.
6 changes: 0 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@

## jest 20.0.3

* Fix arrow typeahead on Windows. ([#3563](https://github.com/facebook/jest/pull/3563))
* Fix reporters 'default' setting. ([#3562](https://github.com/facebook/jest/pull/3562))
* Fix to make Jest fail when the coverage threshold not met. ([#3554](https://github.com/facebook/jest/pull/3554))

Expand All @@ -224,7 +223,6 @@

* New `--projects` option to run one instance of Jest in multiple projects at the same time. ([#3400](https://github.com/facebook/jest/pull/3400))
* New multi project runner ([#3156](https://github.com/facebook/jest/pull/3156))
* New keyboard/arrow selection for watch mode typeaheads. ([#3386](https://github.com/facebook/jest/pull/3386))
* New --listTests flag. ([#3441](https://github.com/facebook/jest/pull/3441))
* New --showConfig flag. ([#3296](https://github.com/facebook/jest/pull/3296))
* New promise support for all `expect` matchers through `.resolves` and `.rejects`. ([#3068](https://github.com/facebook/jest/pull/3068))
Expand Down Expand Up @@ -271,13 +269,11 @@
* Fixed return value of mocks so they can explicitly be set to return `undefined`. ([#3354](https://github.com/facebook/jest/pull/3354))
* Fixed runner to run tests associated with snapshots when the snapshot changes. ([#3025](https://github.com/facebook/jest/pull/3025))
* Fixed snapshot serializer require, restructured pretty-format. ([#3399](https://github.com/facebook/jest/pull/3399))
* Fixed spacing in test name pattern typeahead ([#3315](https://github.com/facebook/jest/pull/3315))
* Fixed support for Babel 7 in babel-jest. ([#3271](https://github.com/facebook/jest/pull/3271))
* Fixed testMatch to find tests in .folders. ([#3006](https://github.com/facebook/jest/pull/3006))
* Fixed testNamePattern and testPathPattern to work better together. ([#3327](https://github.com/facebook/jest/pull/3327))
* Fixed to show reject reason when expecting resolve. ([#3134](https://github.com/facebook/jest/pull/3134))
* Fixed toHaveProperty() to use hasOwnProperty from Object ([#3410](https://github.com/facebook/jest/pull/3410))
* Fixed watch mode typeahead filter cursor behavior. ([#3392](https://github.com/facebook/jest/pull/3392))
* Fixed watch mode's screen clearing. ([#2959](https://github.com/facebook/jest/pull/2959)) ([#3294](https://github.com/facebook/jest/pull/3294))
* Improved and consolidated Jest's configuration file resolution. ([#3472](https://github.com/facebook/jest/pull/3472))
* Improved documentation throughout the Jest website.
Expand Down Expand Up @@ -345,8 +341,6 @@
* New jest-validate package to improve configuration errors, help with suggestions of correct configuration and to be adopted in other libraries.
* New pretty-printing for asymmetric matchers.
* New RSS feed for Jest's blog.
* New typeahead to filter cached test names added to watch mode.
* New typeahead to filter file names added to watch mode (#2324).
* New way to provide a reducer to extract haste module ids.
* New website, new documentation, new color scheme and new homepage.
* Rewritten watch mode for instant feedback, better code quality and to build new features on top of it (#2362).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,7 @@ Today we are pleased to ship version 19 of the Jest testing platform. It's the b

## Immersive Watch Mode

We [completely rewrote the watch mode](https://github.com/facebook/jest/pull/2362) to make it instant and more extensible. As a result, the experience of using it really is immersive: tests re-run instantly after a file change and we added a typeahead to make it easy to select the right tests.

### Filename pattern typeahead

Filtering by filename now has a typeahead. This is particularly useful in large codebases to tell to exactly which files match your current pattern.

![typeahead-pattern](/jest/img/blog/19-typeahead-pattern.gif)

### Cached test name pattern typeahead.

After running tests once, Jest knows which specific tests are available so we also added a typeahead for running specific tests within test suites:
![typeahead-name](/jest/img/blog/19-typeahead-name.gif)
We [completely rewrote the watch mode](https://github.com/facebook/jest/pull/2362) to make it instant and more extensible. As a result, the experience of using it really is immersive: tests re-run instantly after a file change and we made it easy to select the right tests.

<!--truncate-->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ Until now, Jest could only operate in one project at a time. This is often cumbe

<!--truncate-->

Jest is now collapsing the usage guide after the first test run to save vertical space in the terminal. Along with this, we also improved watch mode by adding arrow-key support to the test pattern typeaheads and the test file and test name pattern typeaheads now work together rather than being unrelated features which allow to select the right tests to run more easily:

![typeahead](/jest/img/blog/20-typeahead.png)
Jest is now collapsing the usage guide after the first test run to save vertical space in the terminal.

Further, we completely overhauled how the configuration system works inside of Jest. You can now pass any configuration option through the CLI to overwrite the ones specified in your configuration file. Along with that, we changed Jest to look for a `jest.config.js` file by default which means you are now able to define a Jest configuration using JavaScript as well as being able to configure it through `package.json` like before. Through the addition of all these new features, you are now able to combine Jest in more powerful ways than ever before. For example, if you would like to find out which tests Jest would run given a set of changed files from a commit across multiple projects in a monorepo, you can combine cli arguments like this now:

Expand Down
Loading

0 comments on commit f92c3be

Please sign in to comment.