A platform combines multiple tutorials, projects, documentations, questions and answers for developers
  • Home (current)
  • Documentations
  • About
  • Login
  1. Home
  2. Documentations
  3. Enzyme
  4. .isEmpty()

.isEmpty() => Boolean

Deprecated: Use .exists() instead.

Returns whether or not the wrapper is empty.

Returns

Boolean: whether or not the wrapper is empty.

Example

const wrapper = mount(<div className="some-class" />);
expect(wrapper.find('.other-class').isEmpty()).to.equal(true);

© 2015 Airbnb, Inc.
Licensed under the MIT License.
https://enzymejs.github.io/enzyme/docs/api/ReactWrapper/isEmpty.html

Guides
Migration Guide for enzyme v2.x to v3.x
Using enzyme to Test Components in React Native
Using enzyme with Browserify
Using enzyme with JSDOM
Using enzyme with Jest
Using enzyme with Karma
Using enzyme with Lab and Code
Using enzyme with Mocha
Using enzyme with SystemJS
Using enzyme with Tape and AVA
Using enzyme with Webpack
API Reference
Full Rendering API
Shallow Rendering API
Static Rendering API
enzyme Selectors
Shallow Rendering
.at()
Full DOM Rendering
.at()
.childAt()
.children()
.closest()
.contains()
.containsAllMatchingElements()
.containsAnyMatchingElements()
.containsMatchingElement()
.context()
.debug()
.detach()
.equals()
.every()
.everyWhere()
.exists()
.filter()
.filterWhere()
.find()
.findWhere()
.first()
.forEach()
.get()
.getDOMNode()
.getWrappingComponent()
.hasClass()
.hostNodes()
.html()
.instance()
.invoke()
.is()
.isEmpty()
.isEmptyRender()
.key()
.last()
.map()
.matchesElement()
.mount()
.name()
.not()
.parent()
.parents()
.prop()
.props()
.reduce()
.reduceRight()
.ref()
.render()
.renderProp()
.setContext()
.setProps()
.setState()
.simulate()
.simulateError()
.slice()
.some()
.someWhere()
.state()
.tap()
.text()
.type()
.unmount()
.update()
.childAt()
.children()
.closest()
.contains()
.containsAllMatchingElements()
.containsAnyMatchingElements()
.containsMatchingElement()
.context()
.debug()
.dive()
.equals()
.every()
.everyWhere()
.exists()
.filter()
.filterWhere()
.find()
.findWhere()
.first()
.forEach()
.get()
.getElement()
.getElements()
.getWrappingComponent()
.hasClass()
.hostNodes()
.html()
.instance()
.invoke()
.is()
.isEmpty()
.isEmptyRender()
.key()
.last()
.map()
.matchesElement()
.name()
.not()
.parent()
.parents()
.prop()
.props()
.reduce()
.reduceRight()
.render()
.renderProp()
.setContext()
.setProps()
.setState()
.shallow()
.simulate()
.simulateError()
.slice()
.some()
.someWhere()
.state()
.tap()
.text()
.type()
.unmount()
.update()
Installation
Installation
Working with React 0.13
Working with React 0.14
Working with React 15
Working with React 16
Copyright ©2026 TypeError Powered By AnyPost, page cost 21ms.
Privacy Policy