You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

29 lines
927 B

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.toBeInTheDOM = toBeInTheDOM;
var _jestMatcherUtils = require("jest-matcher-utils");
var _utils = require("./utils");
function toBeInTheDOM(element, container) {
(0, _utils.deprecate)('toBeInTheDOM', 'Please use toBeInTheDocument for searching the entire document and toContainElement for searching a specific container.');
if (element) {
(0, _utils.checkHtmlElement)(element, toBeInTheDOM, this);
}
if (container) {
(0, _utils.checkHtmlElement)(container, toBeInTheDOM, this);
}
return {
pass: container ? container.contains(element) : !!element,
message: () => {
return [(0, _jestMatcherUtils.matcherHint)(`${this.isNot ? '.not' : ''}.toBeInTheDOM`, 'element', ''), '', 'Received:', ` ${(0, _jestMatcherUtils.printReceived)(element ? element.cloneNode(false) : element)}`].join('\n');
}
};
}