You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Note: when using TypeScript, this way of importing matchers won't provide the
96
98
> necessary type definitions. More on this [here](https://github.com/gnapse/jest-dom/pull/11#issuecomment-387817459).
97
99
98
100
## Custom matchers
99
101
100
-
### `toBeInTheDOM`
102
+
### `toBeEmpty`
101
103
102
104
```typescript
103
-
toBeInTheDOM(container?:HTMLElement|SVGElement)
104
-
```
105
-
106
-
This allows you to assert whether an element present in the DOM container or not. If no DOM container is specified it will use the default DOM context.
> Note: This will not find detached elements. The element must be added to the document to be found. If you desire to search in a detached element please use: [`toContainElement`](#tocontainelement)
> Note: The differences between `toBeInTheDOM` and `toBeInTheDocument` are significant. Replacing all uses of `toBeInTheDOM` with `toBeInTheDocument` will likely cause unintended consequences in your tests. Please make sure when replacing `toBeInTheDOM` to read through the replacements below to see which use case works better for your needs.
384
+
385
+
> Please use [`toContainElement`](#tocontainelement) for searching a specific container.
386
+
387
+
> Please use [`toBeInTheDocument`](#tobeinthedocument) for searching the entire document.
388
+
392
389
## Inspiration
393
390
394
391
This whole library was extracted out of Kent C. Dodds' [dom-testing-library][],
0 commit comments