Socket
Socket
Sign inDemoInstall

@testing-library/jest-dom

Package Overview
Dependencies
Maintainers
12
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@testing-library/jest-dom - npm Package Compare versions

Comparing version 5.8.0 to 5.9.0

dist/to-be-empty-dom-element.js

8

dist/matchers.js

@@ -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 @@

1

dist/to-be-empty.js

@@ -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 {

2

package.json
{
"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>

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc