Skip to content

Commit

Permalink
fix(docs): add missing table of contents to The Jest Object documenta…
Browse files Browse the repository at this point in the history
…tion page (#12039)
  • Loading branch information
mrazauskas authored Nov 5, 2021
1 parent 95f4969 commit 8f2cdad
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 12 deletions.
12 changes: 10 additions & 2 deletions docs/JestObjectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ title: The Jest Object

The `jest` object is automatically in scope within every test file. The methods in the `jest` object help create mocks and let you control Jest's overall behavior. It can also be imported explicitly by via `import {jest} from '@jest/globals'`.

## Methods

import TOCInline from "@theme/TOCInline"

<TOCInline toc={toc.slice(1)}/>

---

## Mock Modules

### `jest.disableAutomock()`
Expand Down Expand Up @@ -443,7 +451,7 @@ jest.isolateModules(() => {
const otherCopyOfMyModule = require('myModule');
```

## Mock functions
## Mock Functions

### `jest.fn(implementation)`

Expand Down Expand Up @@ -570,7 +578,7 @@ Returns the `jest` object for chaining.

Restores all mocks back to their original value. Equivalent to calling [`.mockRestore()`](MockFunctionAPI.md#mockfnmockrestore) on every mocked function. Beware that `jest.restoreAllMocks()` only works when the mock was created with `jest.spyOn`; other mocks will require you to manually restore them.

## Mock timers
## Mock Timers

### `jest.useFakeTimers(implementation?: 'modern' | 'legacy')`

Expand Down
12 changes: 10 additions & 2 deletions website/versioned_docs/version-25.x/JestObjectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ title: The Jest Object

The `jest` object is automatically in scope within every test file. The methods in the `jest` object help create mocks and let you control Jest's overall behavior. It can also be imported explicitly by via `import {jest} from '@jest/globals'`.

## Methods

import TOCInline from "@theme/TOCInline"

<TOCInline toc={toc.slice(1)}/>

---

## Mock Modules

### `jest.disableAutomock()`
Expand Down Expand Up @@ -439,7 +447,7 @@ jest.isolateModules(() => {
const otherCopyOfMyModule = require('myModule');
```

## Mock functions
## Mock Functions

### `jest.fn(implementation)`

Expand Down Expand Up @@ -566,7 +574,7 @@ Returns the `jest` object for chaining.

Restores all mocks back to their original value. Equivalent to calling [`.mockRestore()`](MockFunctionAPI.md#mockfnmockrestore) on every mocked function. Beware that `jest.restoreAllMocks()` only works when the mock was created with `jest.spyOn`; other mocks will require you to manually restore them.

## Mock timers
## Mock Timers

### `jest.useFakeTimers()`

Expand Down
12 changes: 10 additions & 2 deletions website/versioned_docs/version-26.x/JestObjectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ title: The Jest Object

The `jest` object is automatically in scope within every test file. The methods in the `jest` object help create mocks and let you control Jest's overall behavior. It can also be imported explicitly by via `import {jest} from '@jest/globals'`.

## Methods

import TOCInline from "@theme/TOCInline"

<TOCInline toc={toc.slice(1)}/>

---

## Mock Modules

### `jest.disableAutomock()`
Expand Down Expand Up @@ -443,7 +451,7 @@ jest.isolateModules(() => {
const otherCopyOfMyModule = require('myModule');
```

## Mock functions
## Mock Functions

### `jest.fn(implementation)`

Expand Down Expand Up @@ -570,7 +578,7 @@ Returns the `jest` object for chaining.

Restores all mocks back to their original value. Equivalent to calling [`.mockRestore()`](MockFunctionAPI.md#mockfnmockrestore) on every mocked function. Beware that `jest.restoreAllMocks()` only works when the mock was created with `jest.spyOn`; other mocks will require you to manually restore them.

## Mock timers
## Mock Timers

### `jest.useFakeTimers(implementation?: 'modern' | 'legacy')`

Expand Down
12 changes: 10 additions & 2 deletions website/versioned_docs/version-27.0/JestObjectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ title: The Jest Object

The `jest` object is automatically in scope within every test file. The methods in the `jest` object help create mocks and let you control Jest's overall behavior. It can also be imported explicitly by via `import {jest} from '@jest/globals'`.

## Methods

import TOCInline from "@theme/TOCInline"

<TOCInline toc={toc.slice(1)}/>

---

## Mock Modules

### `jest.disableAutomock()`
Expand Down Expand Up @@ -443,7 +451,7 @@ jest.isolateModules(() => {
const otherCopyOfMyModule = require('myModule');
```

## Mock functions
## Mock Functions

### `jest.fn(implementation)`

Expand Down Expand Up @@ -570,7 +578,7 @@ Returns the `jest` object for chaining.

Restores all mocks back to their original value. Equivalent to calling [`.mockRestore()`](MockFunctionAPI.md#mockfnmockrestore) on every mocked function. Beware that `jest.restoreAllMocks()` only works when the mock was created with `jest.spyOn`; other mocks will require you to manually restore them.

## Mock timers
## Mock Timers

### `jest.useFakeTimers(implementation?: 'modern' | 'legacy')`

Expand Down
12 changes: 10 additions & 2 deletions website/versioned_docs/version-27.1/JestObjectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ title: The Jest Object

The `jest` object is automatically in scope within every test file. The methods in the `jest` object help create mocks and let you control Jest's overall behavior. It can also be imported explicitly by via `import {jest} from '@jest/globals'`.

## Methods

import TOCInline from "@theme/TOCInline"

<TOCInline toc={toc.slice(1)}/>

---

## Mock Modules

### `jest.disableAutomock()`
Expand Down Expand Up @@ -443,7 +451,7 @@ jest.isolateModules(() => {
const otherCopyOfMyModule = require('myModule');
```

## Mock functions
## Mock Functions

### `jest.fn(implementation)`

Expand Down Expand Up @@ -570,7 +578,7 @@ Returns the `jest` object for chaining.

Restores all mocks back to their original value. Equivalent to calling [`.mockRestore()`](MockFunctionAPI.md#mockfnmockrestore) on every mocked function. Beware that `jest.restoreAllMocks()` only works when the mock was created with `jest.spyOn`; other mocks will require you to manually restore them.

## Mock timers
## Mock Timers

### `jest.useFakeTimers(implementation?: 'modern' | 'legacy')`

Expand Down
12 changes: 10 additions & 2 deletions website/versioned_docs/version-27.2/JestObjectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ title: The Jest Object

The `jest` object is automatically in scope within every test file. The methods in the `jest` object help create mocks and let you control Jest's overall behavior. It can also be imported explicitly by via `import {jest} from '@jest/globals'`.

## Methods

import TOCInline from "@theme/TOCInline"

<TOCInline toc={toc.slice(1)}/>

---

## Mock Modules

### `jest.disableAutomock()`
Expand Down Expand Up @@ -443,7 +451,7 @@ jest.isolateModules(() => {
const otherCopyOfMyModule = require('myModule');
```

## Mock functions
## Mock Functions

### `jest.fn(implementation)`

Expand Down Expand Up @@ -570,7 +578,7 @@ Returns the `jest` object for chaining.

Restores all mocks back to their original value. Equivalent to calling [`.mockRestore()`](MockFunctionAPI.md#mockfnmockrestore) on every mocked function. Beware that `jest.restoreAllMocks()` only works when the mock was created with `jest.spyOn`; other mocks will require you to manually restore them.

## Mock timers
## Mock Timers

### `jest.useFakeTimers(implementation?: 'modern' | 'legacy')`

Expand Down

0 comments on commit 8f2cdad

Please sign in to comment.