Skip to content

Commit 6f581c5

Browse files
committed
Jest 13.0.
1 parent ef1bb8c commit 6f581c5

File tree

24 files changed

+99
-61
lines changed

24 files changed

+99
-61
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
## jest 14.0.0
1+
## jest 13.0.0
22

3+
* Added duration of individual tests in verbose mode.
4+
* Added a `browser` config option to properly resolve npm packages with a
5+
browser field in `package.json` if you are writing tests for client side apps
6+
* Added `jest-repl`.
37
* Split up `jest-cli` into `jest-runtime` and `jest-config`.
48
* Added a notification plugin that shows a test run notification
59
using `--notify`.

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ Jest uses Jasmine 2 by default. An introduction to Jasmine 2 can be found
321321
#### [Configuration Options](https://facebook.github.io/jest/docs/api.html#configuration)
322322

323323
- [`automock` [boolean]](https://facebook.github.io/jest/docs/api.html#automock-boolean)
324+
- [`browser` [boolean]](https://facebook.github.io/jest/docs/api.html#browser-boolean)
324325
- [`bail` [boolean]](https://facebook.github.io/jest/docs/api.html#bail-boolean)
325326
- [`cacheDirectory` [string]](https://facebook.github.io/jest/docs/api.html#cachedirectory-string)
326327
- [`coverageDirectory` [string]](https://facebook.github.io/jest/docs/api.html#coveragedirectory-string)
@@ -696,6 +697,11 @@ JavaScript library and would like to use Jest, you may not want to use
696697
automocking. You can disable this option and create manual mocks or explicitly
697698
mock modules using `jest.mock(moduleName)`.
698699

700+
### `browser` [boolean]
701+
(default: false)
702+
703+
Respect the Browserify's [`"browser"`](https://github.com/substack/browserify-handbook#browser-field) field in `package.json` when resolving modules. Some modules export different versions based on whether they are operating in Node or a browser.
704+
699705
### `bail` [boolean]
700706
(default: false)
701707

blog/2016-06-22-jest-13.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
title: Jest 13.0: Flow, Property Testing and REPL
3+
author: Christoph Pojer
4+
authorURL: http://twitter.com/cpojer
5+
authorFBID: 100000023028168
6+
---
7+
8+
Today we are happy to announce the next major release of Jest. We have made major changes to Jest which are going to benefit you and all of Facebook's JavaScript test infrastructure. Most importantly, we added static types to all of Jest's code during a recent Jest hackathon at Facebook. Fifteen people worked for a day and night to add [Flow](https://flowtype.org/) types to Jest and to add new features to Jest. The Flow types serve two purposes: First, we believe that code is written to be read. Most of the time, code is written only once but read by dozens of people over the course of years. Adding static types to the project helps document the code and helps explain some of the architecture in Jest. Second, adding static types makes maintenance easier and will allow us to more confidently refactor parts of Jest without fear of breakages.
9+
10+
<!--truncate-->
11+
12+
The Flow project has evolved a lot within Facebook and has been successfully adopted across many of our frameworks and almost all of our product code. Adoption can be parallelized incredibly well – it can be done file-by-file until enough of the codebase is well-typed. Then, Flow provides real value and helps guide through large changes. Through this, many small edge cases and bugs were found.
13+
14+
With the help of [lerna](https://github.com/lerna/lerna), we continued to modularize the Jest project. With just a small [update to the configuration](https://github.com/lerna/lerna#lernajson), Flow and lerna now get along well with each other. Splitting up Jest into packages helped us rethink module boundaries and enabled us to ship useful [packages](https://github.com/facebook/jest/tree/master/packages) standalone: The `jest-runtime` and `jest-repl` cli tools now allow you to run scripts in a sandboxed Jest environment, enabling you to run and debug your app from the command line. This is especially helpful for projects that use Facebook's `@providesModule` module convention. To get started, just install `jest-repl` and run it in the same folder you normally run your tests in! We also published a `jest-changed-files` package that finds changed files in version control for either git or hg, a common thing in developer tools.
15+
16+
## New and improved features
17+
18+
* A property testing feature was added directly to Jest, through [testcheck-js](https://github.com/leebyron/testcheck-js) and [jasmine-check](https://github.com/leebyron/jasmine-check/).
19+
* Added a notification plugin that shows a test run notification when using `--notify`.
20+
* Added a `browser` config option to properly resolve npm packages with a browser field in `package.json` if you are writing tests for client side apps.
21+
* Improved “no tests found message” which will now report which tests were found and how they were filtered.
22+
* Added `jest.isMockFunction(jest.fn())` to test for mock functions.
23+
* Improved test reporter printing and added a test failure summary when running many tests.
24+
* Added support for mocking virtual modules through `jest.mock('Module', implementation, {virtual: true})`.
25+
* Removed the `.haste_cache` folder. Jest now uses the operating system's preferred temporary file location.
26+
* Added the duration of individual tests in verbose mode.
27+
* Added the ability to record snapshots in Jest. We'll be publishing a separate blog post about this feature soon.
28+
29+
Finally, we have received a complete website redesign done by Matthew Johnston and added documentation for using [Jest with Webpack](http://facebook.github.io/jest/docs/tutorial-webpack.html#content) and added more information on [debugging Jest tests](http://facebook.github.io/jest/docs/getting-started.html#remote-debugging-with-web-inspector). Happy Jesting!

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"lerna": "2.0.0-beta.20",
3-
"version": "12.1.4",
3+
"version": "13.0.0",
44
"linkedFiles": {
55
"prefix": "/**\n * @flow\n */\n"
66
}

packages/babel-jest/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "babel-jest",
3-
"version": "12.1.0",
3+
"version": "13.0.0",
44
"repository": {
55
"type": "git",
66
"url": "https://github.com/facebook/jest.git"
@@ -9,6 +9,6 @@
99
"main": "build/index.js",
1010
"dependencies": {
1111
"babel-core": "^6.0.0",
12-
"babel-preset-jest": "^12.1.0"
12+
"babel-preset-jest": "^13.0.0"
1313
}
1414
}

packages/babel-plugin-jest-hoist/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "babel-plugin-jest-hoist",
3-
"version": "12.1.0",
3+
"version": "13.0.0",
44
"repository": {
55
"type": "git",
66
"url": "https://github.com/facebook/jest.git"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "babel-preset-jest",
3-
"version": "12.1.0",
3+
"version": "13.0.0",
44
"repository": {
55
"type": "git",
66
"url": "https://github.com/facebook/jest.git"
77
},
88
"license": "BSD-3-Clause",
99
"main": "index.js",
1010
"dependencies": {
11-
"babel-plugin-jest-hoist": "^12.1.0"
11+
"babel-plugin-jest-hoist": "^13.0.0"
1212
}
1313
}

packages/jest-changed-files/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jest-changed-files",
3-
"version": "12.1.0",
3+
"version": "13.0.0",
44
"repository": {
55
"type": "git",
66
"url": "https://github.com/facebook/jest.git"

packages/jest-cli/package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
{
22
"name": "jest-cli",
33
"description": "Painless JavaScript Unit Testing.",
4-
"version": "12.1.1",
4+
"version": "13.0.0",
55
"main": "build/jest.js",
66
"dependencies": {
77
"chalk": "^1.1.1",
88
"graceful-fs": "^4.1.3",
9-
"jest-changed-files": "^12.1.0",
10-
"jest-config": "^12.1.0",
11-
"jest-environment-jsdom": "^12.1.0",
12-
"jest-haste-map": "^12.1.0",
13-
"jest-jasmine1": "^12.1.0",
14-
"jest-jasmine2": "^12.1.0",
15-
"jest-mock": "^12.1.0",
16-
"jest-resolve": "^12.1.1",
17-
"jest-runtime": "^12.1.1",
18-
"jest-util": "^12.1.0",
19-
"jest-snapshot": "^12.1.0",
9+
"jest-changed-files": "^13.0.0",
10+
"jest-config": "^13.0.0",
11+
"jest-environment-jsdom": "^13.0.0",
12+
"jest-haste-map": "^13.0.0",
13+
"jest-jasmine1": "^13.0.0",
14+
"jest-jasmine2": "^13.0.0",
15+
"jest-mock": "^13.0.0",
16+
"jest-resolve": "^13.0.0",
17+
"jest-runtime": "^13.0.0",
18+
"jest-util": "^13.0.0",
19+
"jest-snapshot": "^13.0.0",
2020
"json-stable-stringify": "^1.0.0",
2121
"lodash.template": "^4.2.4",
2222
"sane": "^1.2.0",

packages/jest-config/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jest-config",
3-
"version": "12.1.1",
3+
"version": "13.0.0",
44
"repository": {
55
"type": "git",
66
"url": "https://github.com/facebook/jest.git"
@@ -10,13 +10,13 @@
1010
"dependencies": {
1111
"chalk": "^1.1.1",
1212
"istanbul": "^0.4.2",
13-
"jest-environment-jsdom": "^12.1.0",
14-
"jest-environment-node": "^12.1.0",
15-
"jest-jasmine1": "^12.1.0",
16-
"jest-jasmine2": "^12.1.0",
17-
"jest-mock": "^12.1.0",
18-
"jest-resolve": "^12.1.0",
19-
"jest-util": "^12.1.0",
13+
"jest-environment-jsdom": "^13.0.0",
14+
"jest-environment-node": "^13.0.0",
15+
"jest-jasmine1": "^13.0.0",
16+
"jest-jasmine2": "^13.0.0",
17+
"jest-mock": "^13.0.0",
18+
"jest-resolve": "^13.0.0",
19+
"jest-util": "^13.0.0",
2020
"json-stable-stringify": "^1.0.0",
2121
"node-notifier": "^4.6.0"
2222
},

0 commit comments

Comments
 (0)