Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Basic Usage

## [Shallow Rendering](/docs/api/shallow.md)

```javascript
```jsx
import React from 'react';
import { expect } from 'chai';
import { shallow } from 'enzyme';
Expand Down Expand Up @@ -158,7 +158,7 @@ Read the full [API Documentation](/docs/api/shallow.md)

## [Full DOM Rendering](/docs/api/mount.md)

```javascript
```jsx
import React from 'react';
import sinon from 'sinon';
import { expect } from 'chai';
Expand Down Expand Up @@ -197,7 +197,7 @@ Read the full [API Documentation](/docs/api/mount.md)

## [Static Rendered Markup](/docs/api/render.md)

```javascript
```jsx
import React from 'react';
import { expect } from 'chai';
import { render } from 'enzyme';
Expand Down Expand Up @@ -233,7 +233,7 @@ If you're using React 16.8+ and `.mount()`, Enzyme will wrap apis including [`.s

A common pattern to trigger handlers with `.act()` and assert is:

```javascript
```jsx
const wrapper = mount(<SomeComponent />);
act(() => wrapper.prop('handler')());
wrapper.update();
Expand All @@ -243,7 +243,7 @@ expect(/* ... */);
We cannot wrap the result of `.prop()` (or `.props()`) with `.act()` in Enzyme internally since it will break the equality of the returned value.
However, you could use `.invoke()` to simplify the code:

```javascript
```jsx
const wrapper = mount(<SomeComponent />);
wrapper.invoke('handler')();
expect(/* ... */);
Expand Down