@testing-library/jest-dom
Advanced tools
Comparing version 5.8.0 to 5.9.0
@@ -24,2 +24,8 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "toBeEmptyDOMElement", { | ||
enumerable: true, | ||
get: function () { | ||
return _toBeEmptyDomElement.toBeEmptyDOMElement; | ||
} | ||
}); | ||
Object.defineProperty(exports, "toContainElement", { | ||
@@ -146,2 +152,4 @@ enumerable: true, | ||
var _toBeEmptyDomElement = require("./to-be-empty-dom-element"); | ||
var _toContainElement = require("./to-contain-element"); | ||
@@ -148,0 +156,0 @@ |
@@ -13,2 +13,3 @@ "use strict"; | ||
function toBeEmpty(element) { | ||
(0, _utils.deprecate)('toBeEmpty', 'Please use instead toBeEmptyDOMElement for finding empty nodes in the DOM.'); | ||
(0, _utils.checkHtmlElement)(element, toBeEmpty, this); | ||
@@ -15,0 +16,0 @@ return { |
{ | ||
"name": "@testing-library/jest-dom", | ||
"version": "5.8.0", | ||
"version": "5.9.0", | ||
"description": "Custom jest matchers to test the state of the DOM", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -55,2 +55,3 @@ <div align="center"> | ||
- [`toBeEmpty`](#tobeempty) | ||
- [`toBeEmptyDOMElement`](#tobeemptydomelement) | ||
- [`toBeInTheDocument`](#tobeinthedocument) | ||
@@ -211,4 +212,29 @@ - [`toBeInvalid`](#tobeinvalid) | ||
> Note: This matcher is being deprecated due to a name clash with | ||
> `jest-extended`. See more info in #216. In the future, please use only: | ||
> [`toBeEmptyDOMElement`](#toBeEmptyDOMElement) | ||
<hr /> | ||
### `toBeEmptyDOMElement` | ||
```typescript | ||
toBeEmptyDOMElement() | ||
``` | ||
This allows you to assert whether an element has content or not. | ||
#### Examples | ||
```html | ||
<span data-testid="not-empty"><span data-testid="empty"></span></span> | ||
``` | ||
```javascript | ||
expect(getByTestId('empty')).toBeEmptyDOMElement() | ||
expect(getByTestId('not-empty')).not.toBeEmptyDOMElement() | ||
``` | ||
<hr /> | ||
### `toBeInTheDocument` | ||
@@ -1134,2 +1160,3 @@ | ||
<td align="center"><a href="https://icing.space/"><img src="https://avatars0.githubusercontent.com/u/2635733?v=4" width="100px;" alt=""/><br /><sub><b>Patrick Smith</b></sub></a><br /><a href="https://github.com/testing-library/jest-dom/commits?author=BurntCaramel" title="Code">💻</a> <a href="https://github.com/testing-library/jest-dom/commits?author=BurntCaramel" title="Tests">⚠️</a> <a href="https://github.com/testing-library/jest-dom/commits?author=BurntCaramel" title="Documentation">📖</a></td> | ||
<td align="center"><a href="https://rubenmoya.dev"><img src="https://avatars3.githubusercontent.com/u/905225?v=4" width="100px;" alt=""/><br /><sub><b>Rubén Moya</b></sub></a><br /><a href="https://github.com/testing-library/jest-dom/commits?author=rubenmoya" title="Code">💻</a> <a href="https://github.com/testing-library/jest-dom/commits?author=rubenmoya" title="Tests">⚠️</a> <a href="https://github.com/testing-library/jest-dom/commits?author=rubenmoya" title="Documentation">📖</a></td> | ||
</tr> | ||
@@ -1136,0 +1163,0 @@ </table> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
100572
31
997
1215