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: 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.
383
+
```typescript
384
+
toBeInTheDOM()
385
+
```
386
+
387
+
This allows you to check whether a value is a DOM element, or not.
388
+
389
+
Contrary to what its name implies, this matcher only checks that you passed to
390
+
it a valid DOM element. It does not have a clear definition of that "the DOM"
391
+
is. Therefore, it does not check wether that element is contained anywhere.
384
392
385
-
> Please use [`toContainElement`](#tocontainelement) for searching a specific container.
393
+
This is the main reason why this matcher is deprecated, and will be removed in
394
+
the next major release. You can follow the discussion around this decision in
395
+
more detail [here](https://github.com/gnapse/jest-dom/issues/34).
396
+
397
+
As an alternative, you can use [`toBeInTheDocument`](#tobeinthedocument)
398
+
or [`toContainElement`](#tocontainelement). Or if you just want to check if a
399
+
value is indeed an `HTMLElement` you can always use some of
0 commit comments