Skip to content

Commit

Permalink
12.1.1.
Browse files Browse the repository at this point in the history
Summary: Closes #1062

Differential Revision: D3341617

fbshipit-source-id: ed6d170904d4c839179a7cf588cdbede61e102a4
  • Loading branch information
cpojer authored and Facebook Github Bot 5 committed May 24, 2016
1 parent 71410b4 commit 9cfa9df
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 12 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,11 @@
## master

## jest-cli 12.1.1

* Windows stability fixes.
* Mock module resolution fixes.
* Remove test files from code coverage.

## jest-cli 12.1.0

* Jest is now also published in the `jest` package on npm.
Expand Down
16 changes: 12 additions & 4 deletions README.md
Expand Up @@ -248,6 +248,8 @@ Example Output:
- [`jest.runOnlyPendingTimers()`](https://facebook.github.io/jest/docs/api.html#jest-runonlypendingtimers)
- [`jest.setMock(moduleName, moduleExports)`](https://facebook.github.io/jest/docs/api.html#jest-setmock-modulename-moduleexports)
- [`jest.unmock(moduleName)`](https://facebook.github.io/jest/docs/api.html#jest-unmock-modulename)
- [`jest.useFakeTimers()`](https://facebook.github.io/jest/docs/api.html#jest-usefaketimers)
- [`jest.useRealTimers()`](https://facebook.github.io/jest/docs/api.html#jest-userealtimers)

#### Mock functions

Expand Down Expand Up @@ -400,7 +402,7 @@ The second argument can be used to specify an explicit module factory that is be
});

const moduleName = require('moduleName'); // This runs the function specified as second argument to `jest.mock`.
moduleName(); // Will return "42";
moduleName(); // Will return '42';
```

*Note: When using `babel-jest`, calls to `mock` will automatically be hoisted to the top of the code block. Use `doMock` if you want to explicitly avoid this behavior.*
Expand Down Expand Up @@ -440,6 +442,12 @@ The most common use of this API is for specifying the module a given test intend

*Note: this method was previously called `dontMock`. When using `babel-jest`, calls to `unmock` will automatically be hoisted to the top of the code block. Use `dontMock` if you want to explicitly avoid this behavior.*

### `jest.useFakeTimers()`
Instructs Jest to use fake versions of the standard timer functions (`setTimeout`, `setInterval`, `clearTimeout`, `clearInterval`, `nextTick`, `setImmediate` and `clearImmediate`). Fake timers are used by default.

### `jest.useRealTimers()`
Instructs Jest to use the real versions of the standard timer functions.

## Mock API

### `mockFn.mock.calls`
Expand Down Expand Up @@ -735,7 +743,7 @@ Examples of such compilers include [jstransform](http://github.com/facebook/jstr
*Note: Jest's preprocessor is only ran once per file unless the file has changed. During development of a `scriptPreprocessor` it can be useful to run Jest with `--no-cache` or to frequently [delete Jest's cache](https://facebook.github.io/jest/docs/troubleshooting.html#caching-issues).*

### `preprocessorIgnorePatterns` [array<string>]
(default: `["/node_modules/"]`)
(default: `['/node_modules/']`)

An array of regexp pattern strings that are matched against all source file paths before preprocessing. If the test path matches any of the patterns, it will not be preprocessed.

Expand Down Expand Up @@ -768,7 +776,7 @@ A list of paths to directories that Jest should use to search for tests in.
There are times where you only want Jest to search in a single sub-directory (such as cases where you have a `src/` directory in your repo), but not the rest of the repo.

### `testPathIgnorePatterns` [array<string>]
(default: `["/node_modules/"]`)
(default: `['/node_modules/']`)

An array of regexp pattern strings that are matched against all test paths before executing the test. If the test path matches any of the patterns, it will be skipped.

Expand All @@ -780,7 +788,7 @@ A regexp pattern string that is matched against all test paths before executing
This is useful if you need to override the default. If you are testing one file at a time the default will be set to `/.*/`, however if you pass a blob rather than a single file the default will then be the absolute path of each test file. The override may be needed on windows machines where, for example, the test full path would be `C:/myproject/__tests__/mystest.jsx.jest` and the default pattern would be set as `/C:\myproject\__tests__\mystest.jsx.jest/`.

### `testRegex` [string]
(default: `'__tests__/.*\.js
(default: `'__tests__/.*\.js`)

The pattern Jest uses to detect test files. By default it looks for `.js` files
inside of `__tests__` folders.
Expand Down
6 changes: 3 additions & 3 deletions docs/API.md
Expand Up @@ -175,7 +175,7 @@ The second argument can be used to specify an explicit module factory that is be
});

const moduleName = require('moduleName'); // This runs the function specified as second argument to `jest.mock`.
moduleName(); // Will return "42";
moduleName(); // Will return '42';
```

*Note: When using `babel-jest`, calls to `mock` will automatically be hoisted to the top of the code block. Use `doMock` if you want to explicitly avoid this behavior.*
Expand Down Expand Up @@ -516,7 +516,7 @@ Examples of such compilers include [jstransform](http://github.com/facebook/jstr
*Note: Jest's preprocessor is only ran once per file unless the file has changed. During development of a `scriptPreprocessor` it can be useful to run Jest with `--no-cache` or to frequently [delete Jest's cache](/jest/docs/troubleshooting.html#caching-issues).*

### `preprocessorIgnorePatterns` [array<string>]
(default: `["/node_modules/"]`)
(default: `['/node_modules/']`)

An array of regexp pattern strings that are matched against all source file paths before preprocessing. If the test path matches any of the patterns, it will not be preprocessed.

Expand Down Expand Up @@ -549,7 +549,7 @@ A list of paths to directories that Jest should use to search for tests in.
There are times where you only want Jest to search in a single sub-directory (such as cases where you have a `src/` directory in your repo), but not the rest of the repo.

### `testPathIgnorePatterns` [array<string>]
(default: `["/node_modules/"]`)
(default: `['/node_modules/']`)

An array of regexp pattern strings that are matched against all test paths before executing the test. If the test path matches any of the patterns, it will be skipped.

Expand Down
2 changes: 1 addition & 1 deletion lerna.json
@@ -1,4 +1,4 @@
{
"lerna": "2.0.0-beta.10",
"version": "12.1.0"
"version": "12.1.1"
}
4 changes: 2 additions & 2 deletions packages/jest-cli/package.json
@@ -1,7 +1,7 @@
{
"name": "jest-cli",
"description": "Painless JavaScript Unit Testing.",
"version": "12.1.0",
"version": "12.1.1",
"main": "src/jest.js",
"dependencies": {
"chalk": "^1.1.1",
Expand All @@ -15,7 +15,7 @@
"jest-jasmine1": "^12.1.0",
"jest-jasmine2": "^12.1.0",
"jest-mock": "^12.1.0",
"jest-resolve": "^12.1.0",
"jest-resolve": "^12.1.1",
"jest-util": "^12.1.0",
"json-stable-stringify": "^1.0.0",
"lodash.template": "^4.2.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-resolve/package.json
@@ -1,6 +1,6 @@
{
"name": "jest-resolve",
"version": "12.1.0",
"version": "12.1.1",
"repository": {
"type": "git",
"url": "https://github.com/facebook/jest.git"
Expand Down
2 changes: 1 addition & 1 deletion packages/jest/package.json
Expand Up @@ -4,7 +4,7 @@
"version": "12.1.1",
"main": "src/jest.js",
"dependencies": {
"jest-cli": "^12.1.0"
"jest-cli": "^12.1.1"
},
"bin": {
"jest": "./bin/jest.js"
Expand Down

0 comments on commit 9cfa9df

Please sign in to comment.