Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
[React Testing] Update README from toContainHtml to toContainReactHtml (
Browse files Browse the repository at this point in the history
#1527)

It doesn't seem like there is a matcher called `toContainHtml`, it seems like this doc is referring to `toContainReactHtml`
  • Loading branch information
andrewlo authored Jun 22, 2020
1 parent 0611697 commit 06e2ce7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react-testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -644,13 +644,13 @@ const myComponent = mount(<MyComponent />);
expect(myComponent).toContainReactText('Hello world!');
```

#### <a name="toContainHtml"></a> `.toContainHtml(text: string)`
#### <a name="toContainReactHtml"></a> `.toContainReactHtml(text: string)`

Asserts that the rendered output of the component contains the passed string as HTML (that is, the text is included in what you would get by calling `outerHTML` on all root DOM nodes rendered by the component).

```tsx
const myComponent = mount(<MyComponent />);
expect(myComponent).toContainHtml('<span>Hello world!</span>');
expect(myComponent).toContainReactHtml('<span>Hello world!</span>');
```

## FAQ
Expand Down

0 comments on commit 06e2ce7

Please sign in to comment.