Socket
Socket
Sign inDemoInstall

@testing-library/jest-dom

Package Overview
Dependencies
Maintainers
16
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.14.1 to 5.15.0

96

dist/matchers.js

@@ -6,12 +6,12 @@ "use strict";

});
Object.defineProperty(exports, "toBeInTheDOM", {
Object.defineProperty(exports, "toBeChecked", {
enumerable: true,
get: function () {
return _toBeInTheDom.toBeInTheDOM;
return _toBeChecked.toBeChecked;
}
});
Object.defineProperty(exports, "toBeInTheDocument", {
Object.defineProperty(exports, "toBeDisabled", {
enumerable: true,
get: function () {
return _toBeInTheDocument.toBeInTheDocument;
return _toBeDisabled.toBeDisabled;
}

@@ -31,132 +31,132 @@ });

});
Object.defineProperty(exports, "toContainElement", {
Object.defineProperty(exports, "toBeEnabled", {
enumerable: true,
get: function () {
return _toContainElement.toContainElement;
return _toBeDisabled.toBeEnabled;
}
});
Object.defineProperty(exports, "toContainHTML", {
Object.defineProperty(exports, "toBeInTheDOM", {
enumerable: true,
get: function () {
return _toContainHtml.toContainHTML;
return _toBeInTheDom.toBeInTheDOM;
}
});
Object.defineProperty(exports, "toHaveTextContent", {
Object.defineProperty(exports, "toBeInTheDocument", {
enumerable: true,
get: function () {
return _toHaveTextContent.toHaveTextContent;
return _toBeInTheDocument.toBeInTheDocument;
}
});
Object.defineProperty(exports, "toHaveAccessibleDescription", {
Object.defineProperty(exports, "toBeInvalid", {
enumerable: true,
get: function () {
return _toHaveAccessibleDescription.toHaveAccessibleDescription;
return _toBeInvalid.toBeInvalid;
}
});
Object.defineProperty(exports, "toHaveAccessibleName", {
Object.defineProperty(exports, "toBePartiallyChecked", {
enumerable: true,
get: function () {
return _toHaveAccessibleName.toHaveAccessibleName;
return _toBePartiallyChecked.toBePartiallyChecked;
}
});
Object.defineProperty(exports, "toHaveAttribute", {
Object.defineProperty(exports, "toBeRequired", {
enumerable: true,
get: function () {
return _toHaveAttribute.toHaveAttribute;
return _toBeRequired.toBeRequired;
}
});
Object.defineProperty(exports, "toHaveClass", {
Object.defineProperty(exports, "toBeValid", {
enumerable: true,
get: function () {
return _toHaveClass.toHaveClass;
return _toBeInvalid.toBeValid;
}
});
Object.defineProperty(exports, "toHaveStyle", {
Object.defineProperty(exports, "toBeVisible", {
enumerable: true,
get: function () {
return _toHaveStyle.toHaveStyle;
return _toBeVisible.toBeVisible;
}
});
Object.defineProperty(exports, "toHaveFocus", {
Object.defineProperty(exports, "toContainElement", {
enumerable: true,
get: function () {
return _toHaveFocus.toHaveFocus;
return _toContainElement.toContainElement;
}
});
Object.defineProperty(exports, "toHaveFormValues", {
Object.defineProperty(exports, "toContainHTML", {
enumerable: true,
get: function () {
return _toHaveFormValues.toHaveFormValues;
return _toContainHtml.toContainHTML;
}
});
Object.defineProperty(exports, "toBeVisible", {
Object.defineProperty(exports, "toHaveAccessibleDescription", {
enumerable: true,
get: function () {
return _toBeVisible.toBeVisible;
return _toHaveAccessibleDescription.toHaveAccessibleDescription;
}
});
Object.defineProperty(exports, "toBeDisabled", {
Object.defineProperty(exports, "toHaveAccessibleName", {
enumerable: true,
get: function () {
return _toBeDisabled.toBeDisabled;
return _toHaveAccessibleName.toHaveAccessibleName;
}
});
Object.defineProperty(exports, "toBeEnabled", {
Object.defineProperty(exports, "toHaveAttribute", {
enumerable: true,
get: function () {
return _toBeDisabled.toBeEnabled;
return _toHaveAttribute.toHaveAttribute;
}
});
Object.defineProperty(exports, "toBeRequired", {
Object.defineProperty(exports, "toHaveClass", {
enumerable: true,
get: function () {
return _toBeRequired.toBeRequired;
return _toHaveClass.toHaveClass;
}
});
Object.defineProperty(exports, "toBeInvalid", {
Object.defineProperty(exports, "toHaveDescription", {
enumerable: true,
get: function () {
return _toBeInvalid.toBeInvalid;
return _toHaveDescription.toHaveDescription;
}
});
Object.defineProperty(exports, "toBeValid", {
Object.defineProperty(exports, "toHaveDisplayValue", {
enumerable: true,
get: function () {
return _toBeInvalid.toBeValid;
return _toHaveDisplayValue.toHaveDisplayValue;
}
});
Object.defineProperty(exports, "toHaveValue", {
Object.defineProperty(exports, "toHaveErrorMessage", {
enumerable: true,
get: function () {
return _toHaveValue.toHaveValue;
return _toHaveErrormessage.toHaveErrorMessage;
}
});
Object.defineProperty(exports, "toHaveDisplayValue", {
Object.defineProperty(exports, "toHaveFocus", {
enumerable: true,
get: function () {
return _toHaveDisplayValue.toHaveDisplayValue;
return _toHaveFocus.toHaveFocus;
}
});
Object.defineProperty(exports, "toBeChecked", {
Object.defineProperty(exports, "toHaveFormValues", {
enumerable: true,
get: function () {
return _toBeChecked.toBeChecked;
return _toHaveFormValues.toHaveFormValues;
}
});
Object.defineProperty(exports, "toBePartiallyChecked", {
Object.defineProperty(exports, "toHaveStyle", {
enumerable: true,
get: function () {
return _toBePartiallyChecked.toBePartiallyChecked;
return _toHaveStyle.toHaveStyle;
}
});
Object.defineProperty(exports, "toHaveDescription", {
Object.defineProperty(exports, "toHaveTextContent", {
enumerable: true,
get: function () {
return _toHaveDescription.toHaveDescription;
return _toHaveTextContent.toHaveTextContent;
}
});
Object.defineProperty(exports, "toHaveErrorMessage", {
Object.defineProperty(exports, "toHaveValue", {
enumerable: true,
get: function () {
return _toHaveErrormessage.toHaveErrorMessage;
return _toHaveValue.toHaveValue;
}

@@ -163,0 +163,0 @@ });

@@ -19,5 +19,7 @@ "use strict";

if (!isValidInput() && !(() => {
const isValidAriaElement = () => {
return roleSupportsChecked(element.getAttribute('role')) && ['true', 'false'].includes(element.getAttribute('aria-checked'));
})()) {
};
if (!isValidInput() && !isValidAriaElement()) {
return {

@@ -24,0 +26,0 @@ pass: false,

@@ -30,3 +30,3 @@ "use strict";

message: () => {
return [this.utils.matcherHint(`${this.isNot ? '.not' : ''}.toBeInTheDocument`, 'element', ''), '', // eslint-disable-next-line babel/new-cap
return [this.utils.matcherHint(`${this.isNot ? '.not' : ''}.toBeInTheDocument`, 'element', ''), '', // eslint-disable-next-line @babel/new-cap
this.utils.RECEIVED_COLOR(this.isNot ? errorFound() : errorNotFound())].join('\n');

@@ -33,0 +33,0 @@ }

@@ -17,5 +17,7 @@ "use strict";

if (!isValidInput() && !(() => {
const isValidAriaElement = () => {
return element.getAttribute('role') === 'checkbox';
})()) {
};
if (!isValidInput() && !isValidAriaElement()) {
return {

@@ -22,0 +24,0 @@ pass: false,

@@ -20,3 +20,3 @@ "use strict";

message: () => {
return [this.utils.matcherHint(`${this.isNot ? '.not' : ''}.toContainElement`, 'element', 'element'), '', // eslint-disable-next-line babel/new-cap
return [this.utils.matcherHint(`${this.isNot ? '.not' : ''}.toContainElement`, 'element', 'element'), '', // eslint-disable-next-line @babel/new-cap
this.utils.RECEIVED_COLOR(`${this.utils.stringify(container.cloneNode(false))} ${this.isNot ? 'contains:' : 'does not contain:'} ${this.utils.stringify(element ? element.cloneNode(false) : element)}

@@ -23,0 +23,0 @@ `)].join('\n');

@@ -26,3 +26,3 @@ "use strict";

message: () => {
return [this.utils.matcherHint(`${this.isNot ? '.not' : ''}.toContainHTML`, 'element', ''), 'Expected:', // eslint-disable-next-line babel/new-cap
return [this.utils.matcherHint(`${this.isNot ? '.not' : ''}.toContainHTML`, 'element', ''), 'Expected:', // eslint-disable-next-line @babel/new-cap
` ${this.utils.EXPECTED_COLOR(htmlText)}`, 'Received:', ` ${this.utils.printReceived(container.cloneNode(true))}`].join('\n');

@@ -29,0 +29,0 @@ }

@@ -8,18 +8,18 @@ "use strict";

});
exports.NodeTypeError = exports.HtmlElementTypeError = void 0;
exports.checkHtmlElement = checkHtmlElement;
exports.checkNode = checkNode;
exports.parseCSS = parseCSS;
exports.compareArraysAsSet = compareArraysAsSet;
exports.deprecate = deprecate;
exports.getMessage = getMessage;
exports.getSingleElementValue = getSingleElementValue;
exports.getTag = getTag;
exports.matches = matches;
exports.normalize = normalize;
exports.getTag = getTag;
exports.getSingleElementValue = getSingleElementValue;
exports.compareArraysAsSet = compareArraysAsSet;
exports.parseCSS = parseCSS;
exports.toSentence = toSentence;
exports.NodeTypeError = exports.HtmlElementTypeError = void 0;
var _redent = _interopRequireDefault(require("redent"));
var _css = require("css");
var _parse = _interopRequireDefault(require("css/lib/parse"));

@@ -45,3 +45,3 @@ var _isEqual = _interopRequireDefault(require("lodash/isEqual"));

this.message = [context.utils.matcherHint(`${context.isNot ? '.not' : ''}.${matcherFn.name}`, 'received', ''), '', // eslint-disable-next-line babel/new-cap
this.message = [context.utils.matcherHint(`${context.isNot ? '.not' : ''}.${matcherFn.name}`, 'received', ''), '', // eslint-disable-next-line @babel/new-cap
`${context.utils.RECEIVED_COLOR('received')} value must ${expectedString}.`, withType].join('\n');

@@ -103,4 +103,4 @@ }

this.message = [received.message, '', // eslint-disable-next-line babel/new-cap
context.utils.RECEIVED_COLOR(`Failing css:`), // eslint-disable-next-line babel/new-cap
this.message = [received.message, '', // eslint-disable-next-line @babel/new-cap
context.utils.RECEIVED_COLOR(`Failing css:`), // eslint-disable-next-line @babel/new-cap
context.utils.RECEIVED_COLOR(`${received.css}`)].join('\n');

@@ -112,3 +112,3 @@ }

function parseCSS(css, ...args) {
const ast = (0, _css.parse)(`selector { ${css} }`, {
const ast = (0, _parse.default)(`selector { ${css} }`, {
silent: true

@@ -142,4 +142,4 @@ }).stylesheet;

function getMessage(context, matcher, expectedLabel, expectedValue, receivedLabel, receivedValue) {
return [`${matcher}\n`, // eslint-disable-next-line babel/new-cap
`${expectedLabel}:\n${context.utils.EXPECTED_COLOR((0, _redent.default)(display(context, expectedValue), 2))}`, // eslint-disable-next-line babel/new-cap
return [`${matcher}\n`, // eslint-disable-next-line @babel/new-cap
`${expectedLabel}:\n${context.utils.EXPECTED_COLOR((0, _redent.default)(display(context, expectedValue), 2))}`, // eslint-disable-next-line @babel/new-cap
`${receivedLabel}:\n${context.utils.RECEIVED_COLOR((0, _redent.default)(display(context, receivedValue), 2))}`].join('\n');

@@ -146,0 +146,0 @@ }

{
"name": "@testing-library/jest-dom",
"version": "5.14.1",
"version": "5.15.0",
"description": "Custom jest matchers to test the state of the DOM",

@@ -48,3 +48,3 @@ "main": "dist/index.js",

"jsdom": "^16.2.1",
"kcd-scripts": "^5.6.0",
"kcd-scripts": "^11.1.0",
"pretty-format": "^25.1.0"

@@ -55,3 +55,3 @@ },

"rules": {
"babel/no-invalid-this": "off"
"@babel/no-invalid-this": "off"
},

@@ -58,0 +58,0 @@ "overrides": [

Sorry, the diff of this file is too big to display

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