to-be-empty.js 605 B

12345678910111213141516171819
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.toBeEmpty = toBeEmpty;
  6. var _utils = require("./utils");
  7. function toBeEmpty(element) {
  8. (0, _utils.deprecate)('toBeEmpty', 'Please use instead toBeEmptyDOMElement for finding empty nodes in the DOM.');
  9. (0, _utils.checkHtmlElement)(element, toBeEmpty, this);
  10. return {
  11. pass: element.innerHTML === '',
  12. message: () => {
  13. return [this.utils.matcherHint(`${this.isNot ? '.not' : ''}.toBeEmpty`, 'element', ''), '', 'Received:', ` ${this.utils.printReceived(element.innerHTML)}`].join('\n');
  14. }
  15. };
  16. }