Skip to content

Commit

Permalink
Backfill 22.x docs (#5822)
Browse files Browse the repository at this point in the history
  • Loading branch information
rickhanlonii authored and mjesun committed Mar 27, 2018
1 parent 5ec4092 commit 5bd6ee1
Show file tree
Hide file tree
Showing 90 changed files with 19,198 additions and 147 deletions.
4 changes: 4 additions & 0 deletions crowdin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ files:
'vi': 'vi'
'zh-CN': 'zh-Hans'
'zh-TW': 'zh-Hant'
-
source: '/website/versioned_docs/**/*.md'
translation: '/website/translated_docs/%locale%/**/%original_file_name%'
languages_mapping: *anchor
-
source: '/website/i18n/en.json'
translation: '/website/i18n/%locale%.json'
Expand Down
4 changes: 0 additions & 4 deletions docs/CLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,6 @@ commit. Behaves similarly to `--onlyChanged`.

### `--changedSince`

##### available in Jest **22.2.0+**

Runs tests related the changes since the provided branch. If the current branch
has diverged from the given branch, then only changes made locally will be
tested. Behaves similarly to `--onlyChanged`.
Expand All @@ -144,8 +142,6 @@ fail the test and require Jest to be run with `--updateSnapshot`.

### `--clearCache`

##### available in Jest **22.0.0+**

Deletes the Jest cache directory and then exits without running tests. Will
delete `cacheDirectory` if the option is passed, or Jest's default cache
directory. The default cache directory can be found by calling
Expand Down
16 changes: 0 additions & 16 deletions docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,6 @@ tests._

Default: `undefined`

##### available in Jest **20.0.0+**

Use this configuration option to add custom reporters to Jest. A custom reporter
is a class that implements `onRunStart`, `onTestStart`, `onTestResult`,
`onRunComplete` methods that will be called when any of those events occurs.
Expand Down Expand Up @@ -606,8 +604,6 @@ programmatically using [`jest.resetModules()`](#jest-resetmodules).

Default: `undefined`

##### available in Jest **20.0.0+**

This option allows the use of a custom resolver. This resolver must be a node
module that exports a function expecting a string as the first argument for the
path to resolve and an object with the following structure as the second
Expand Down Expand Up @@ -677,8 +673,6 @@ where you may want to have multiple roots within one project, for example

### `runner` [string]

##### available in Jest **21.0.0+**

Default: `"jest-runner"`

This option allows you to use a custom runner instead of Jest's default test
Expand Down Expand Up @@ -816,8 +810,6 @@ you can use the `node` option to use a node-like environment instead.
If some tests require another environment, you can add a `@jest-environment`
docblock.

##### available in Jest **20.0.0+**

```js
/**
* @jest-environment jsdom
Expand All @@ -835,8 +827,6 @@ environment. The module must export a class with `setup`, `teardown` and
suites by assigning them to `this.global` object – this will make them
available in your test suites as global variables.

##### available in Jest **22.0.0+**

_Note: TestEnvironment is sandboxed. Each test suite will trigger setup/teardown
in their own TestEnvironment._

Expand Down Expand Up @@ -880,8 +870,6 @@ beforeAll(() => {

### `testEnvironmentOptions` [Object]

##### available in Jest **22.0.0+**

Default: `{}`

Test environment options that will be passed to the `testEnvironment`. The
Expand All @@ -891,8 +879,6 @@ given to [jsdom](https://github.com/tmpvar/jsdom) such as

### `testMatch` [array<string>]

##### available in Jest **19.0.0+**

(default: `[ '**/__tests__/**/*.js?(x)', '**/?(*.)+(spec|test).js?(x)' ]`)

The glob patterns Jest uses to detect test files. By default it looks for `.js`
Expand Down Expand Up @@ -1110,8 +1096,6 @@ errors will also still be shown on the bottom after execution.

Default: `[]`

##### available in Jest **21.0.0+**

An array of RegExp patterns that are matched against all source file paths
before re-running tests in watch mode. If the file path matches any of the
patterns, when it is updated, it will not trigger a re-run of tests.
Expand Down
4 changes: 0 additions & 4 deletions docs/ExpectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,6 @@ test('the best flavor is not coconut', () => {

### `.resolves`

##### available in Jest **20.0.0+**

Use `resolves` to unwrap the value of a fulfilled promise so any other matcher
can be chained. If the promise is rejected the assertion fails.

Expand Down Expand Up @@ -485,8 +483,6 @@ test('resolves to lemon', async () => {

### `.rejects`

##### available in Jest **20.0.0+**

Use `.rejects` to unwrap the reason of a rejected promise so any other matcher
can be chained. If the promise is fulfilled the assertion fails.

Expand Down
6 changes: 0 additions & 6 deletions docs/JestObjectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,6 @@ Returns the `jest` object for chaining.

### `jest.restoreAllMocks()`

##### available in Jest **21.1.0+**

Restores all mocks back to their original value. Equivalent to calling
`.mockRestore` on every mocked function. Beware that `jest.restoreAllMocks()`
only works when mock was created with `jest.spyOn`; other mocks will require you
Expand Down Expand Up @@ -464,8 +462,6 @@ Returns the `jest` object for chaining.

### `jest.spyOn(object, methodName)`

##### available in Jest **19.0.0+**

Creates a mock function similar to `jest.fn` but also tracks calls to
`object[methodName]`. Returns a Jest mock function.

Expand Down Expand Up @@ -506,8 +502,6 @@ test('plays video', () => {

### `jest.spyOn(object, methodName, accessType?)`

##### available in Jest **22.1.0+**

Since Jest 22.1.0+, the `jest.spyOn` method takes an optional third argument of
`accessType` that can be either `'get'` or `'set'`, which proves to be useful
when you want to spy on a getter or a setter, respectively.
Expand Down
12 changes: 0 additions & 12 deletions docs/MockFunctionAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ implementation is given, the mock function will return `undefined` when invoked.

### `mockFn.getMockName()`

##### available in Jest **22.0.0+**

Returns the mock name string set by calling `mockFn.mockName(value)`.

### `mockFn.mock.calls`
Expand Down Expand Up @@ -211,8 +209,6 @@ console.log(myMockFn(), myMockFn(), myMockFn(), myMockFn());

### `mockFn.mockName(value)`

##### available in Jest **22.0.0+**

Accepts a string to use in test result output in place of "jest.fn()" to
indicate which mock function is being referenced.

Expand Down Expand Up @@ -274,8 +270,6 @@ console.log(myMockFn(), myMockFn(), myMockFn(), myMockFn());

### `mockFn.mockResolvedValue(value)`

##### available in Jest **22.2.0+**

Simple sugar function for:

```js
Expand All @@ -294,8 +288,6 @@ test('async test', async () => {

### `mockFn.mockResolvedValueOnce(value)`

##### available in Jest **22.2.0+**

Simple sugar function for:

```js
Expand All @@ -321,8 +313,6 @@ test('async test', async () => {

### `mockFn.mockRejectedValue(value)`

##### available in Jest **22.2.0+**

Simple sugar function for:

```js
Expand All @@ -341,8 +331,6 @@ test('async test', async () => {

### `mockFn.mockRejectedValueOnce(value)`

##### available in Jest **22.2.0+**

Simple sugar function for:

```js
Expand Down
2 changes: 0 additions & 2 deletions docs/MockFunctions.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,6 @@ const otherObj = {

## Mock Names

##### available in Jest **22.0.0+**

You can optionally provide a name for your mock functions, which will be
displayed instead of "jest.fn()" in test error output. Use this if you want to
be able to quickly identify the mock function reporting an error in your test
Expand Down
5 changes: 1 addition & 4 deletions docs/TestingAsyncCode.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ test('the fetch fails with an error', () => {

### `.resolves` / `.rejects`

##### available in Jest **20.0.0+**

You can also use the `.resolves` matcher in your expect statement, and Jest will
wait for that promise to resolve. If the promise is rejected, the test will
automatically fail.
Expand Down Expand Up @@ -136,8 +134,7 @@ test('the fetch fails with an error', async () => {
});
```

Of course, you can combine `async` and `await` with `.resolves` or `.rejects`
(available in Jest **20.0.0+**).
Of course, you can combine `async` and `await` with `.resolves` or `.rejects`.

```js
test('the data is peanut butter', async () => {
Expand Down
4 changes: 0 additions & 4 deletions docs/TutorialAsync.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ return a Promise at the end.

### `.resolves`

##### available in Jest **20.0.0+**

There is a less verbose way using `resolves` to unwrap the value of a fulfilled
promise together with any other matcher. If the promise is rejected, the
assertion will fail.
Expand Down Expand Up @@ -159,8 +157,6 @@ it('tests error with async/await', async () => {

### `.rejects`

##### available in Jest **20.0.0+**

The`.rejects` helper works like the `.resolves` helper. If the promise is
fulfilled, the test will automatically fail.

Expand Down
2 changes: 1 addition & 1 deletion website/pages/en/versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class Versions extends React.Component {
version =>
version !== latestVersion && (
<tr key={version}>
<th>{version}</th>
<th>{version === '22.0' ? '<=22' : version}</th>
<td>
<a
href={`${
Expand Down
Loading

0 comments on commit 5bd6ee1

Please sign in to comment.