Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsx for code blocks #2386

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
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