@testing-library/jest-native
Advanced tools
Comparing version 4.0.5 to 4.0.6
@@ -0,1 +1,3 @@ | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -7,4 +9,14 @@ value: true | ||
var _ramda = require("ramda"); | ||
var _compose = _interopRequireDefault(require("ramda/src/compose")); | ||
var _defaultTo = _interopRequireDefault(require("ramda/src/defaultTo")); | ||
var _includes = _interopRequireDefault(require("ramda/src/includes")); | ||
var _path = _interopRequireDefault(require("ramda/src/path")); | ||
var _propEq = _interopRequireDefault(require("ramda/src/propEq")); | ||
var _anyPass = _interopRequireDefault(require("ramda/src/anyPass")); | ||
var _jestMatcherUtils = require("jest-matcher-utils"); | ||
@@ -21,6 +33,6 @@ | ||
function isElementDisabled(element) { | ||
var propDisabled = (0, _ramda.path)(['props', 'disabled'], element); | ||
var hasStatesDisabled = (0, _ramda.compose)((0, _ramda.includes)('disabled'), (0, _ramda.defaultTo)([]), (0, _ramda.path)(['props', 'accessibilityStates'])); | ||
var hasStateDisabled = (0, _ramda.compose)((0, _ramda.propEq)('disabled', true), (0, _ramda.defaultTo)({}), (0, _ramda.path)(['props', 'accessibilityState'])); | ||
var stateDisabled = (0, _ramda.anyPass)([hasStatesDisabled, hasStateDisabled])(element); | ||
var propDisabled = (0, _path.default)(['props', 'disabled'], element); | ||
var hasStatesDisabled = (0, _compose.default)((0, _includes.default)('disabled'), (0, _defaultTo.default)([]), (0, _path.default)(['props', 'accessibilityStates'])); | ||
var hasStateDisabled = (0, _compose.default)((0, _propEq.default)('disabled', true), (0, _defaultTo.default)({}), (0, _path.default)(['props', 'accessibilityState'])); | ||
var stateDisabled = (0, _anyPass.default)([hasStatesDisabled, hasStateDisabled])(element); | ||
return DISABLE_TYPES.includes((0, _utils.getType)(element)) && (Boolean(propDisabled) || stateDisabled); | ||
@@ -27,0 +39,0 @@ } |
@@ -0,1 +1,3 @@ | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -8,4 +10,10 @@ value: true | ||
var _ramda = require("ramda"); | ||
var _compose = _interopRequireDefault(require("ramda/src/compose")); | ||
var _defaultTo = _interopRequireDefault(require("ramda/src/defaultTo")); | ||
var _path = _interopRequireDefault(require("ramda/src/path")); | ||
var _isEmpty = _interopRequireDefault(require("ramda/src/isEmpty")); | ||
var _utils = require("./utils"); | ||
@@ -18,3 +26,3 @@ | ||
return { | ||
pass: (0, _ramda.compose)(_ramda.isEmpty, (0, _ramda.defaultTo)({}), (0, _ramda.path)(['props', 'children']))(element), | ||
pass: (0, _compose.default)(_isEmpty.default, (0, _defaultTo.default)({}), (0, _path.default)(['props', 'children']))(element), | ||
message: function message() { | ||
@@ -21,0 +29,0 @@ return [(0, _jestMatcherUtils.matcherHint)((_this.isNot ? '.not' : '') + ".toBeEmpty", 'element', ''), '', 'Received:', (0, _utils.printElement)(element)].join('\n'); |
@@ -0,1 +1,3 @@ | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -6,3 +8,3 @@ value: true | ||
var _ramda = require("ramda"); | ||
var _equals = _interopRequireDefault(require("ramda/src/equals")); | ||
@@ -26,4 +28,4 @@ var _jestMatcherUtils = require("jest-matcher-utils"); | ||
matches = container.findAll(function (node) { | ||
var sameType = (0, _ramda.equals)(node.type, element.type); | ||
var sameProps = (0, _ramda.equals)(node.props, element.props); | ||
var sameType = (0, _equals.default)(node.type, element.type); | ||
var sameProps = (0, _equals.default)(node.props, element.props); | ||
return sameType && sameProps; | ||
@@ -30,0 +32,0 @@ }); |
@@ -0,1 +1,3 @@ | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -6,3 +8,3 @@ value: true | ||
var _ramda = require("ramda"); | ||
var _equals = _interopRequireDefault(require("ramda/src/equals")); | ||
@@ -29,3 +31,3 @@ var _jestMatcherUtils = require("jest-matcher-utils"); | ||
return { | ||
pass: isDefined ? hasProp && (0, _ramda.equals)(prop, expectedValue) : hasProp, | ||
pass: isDefined ? hasProp && (0, _equals.default)(prop, expectedValue) : hasProp, | ||
message: function message() { | ||
@@ -32,0 +34,0 @@ var to = _this.isNot ? 'not to' : 'to'; |
@@ -18,8 +18,16 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
var _ramda = require("ramda"); | ||
var _compose = _interopRequireDefault(require("ramda/src/compose")); | ||
var _all = _interopRequireDefault(require("ramda/src/all")); | ||
var _flatten = _interopRequireDefault(require("ramda/src/flatten")); | ||
var _mergeAll = _interopRequireDefault(require("ramda/src/mergeAll")); | ||
var _toPairs = _interopRequireDefault(require("ramda/src/toPairs")); | ||
var _utils = require("./utils"); | ||
function isSubset(expected, received) { | ||
return (0, _ramda.compose)((0, _ramda.all)(function (_ref) { | ||
return (0, _compose.default)((0, _all.default)(function (_ref) { | ||
var _ref2 = (0, _slicedToArray2.default)(_ref, 2), | ||
@@ -29,8 +37,8 @@ prop = _ref2[0], | ||
return Array.isArray(value) ? isSubset((0, _ramda.mergeAll)(value), (0, _ramda.mergeAll)(received[prop])) : received[prop] === value; | ||
}), _ramda.toPairs)(expected); | ||
return Array.isArray(value) ? isSubset((0, _mergeAll.default)(value), (0, _mergeAll.default)(received[prop])) : received[prop] === value; | ||
}), _toPairs.default)(expected); | ||
} | ||
function mergeAllStyles(styles) { | ||
return (0, _ramda.compose)(_ramda.mergeAll, _ramda.flatten)(styles); | ||
return (0, _compose.default)(_mergeAll.default, _flatten.default)(styles); | ||
} | ||
@@ -37,0 +45,0 @@ |
@@ -0,1 +1,3 @@ | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -8,4 +10,16 @@ value: true | ||
var _ramda = require("ramda"); | ||
var _compose = _interopRequireDefault(require("ramda/src/compose")); | ||
var _defaultTo = _interopRequireDefault(require("ramda/src/defaultTo")); | ||
var _is = _interopRequireDefault(require("ramda/src/is")); | ||
var _join = _interopRequireDefault(require("ramda/src/join")); | ||
var _map = _interopRequireDefault(require("ramda/src/map")); | ||
var _path = _interopRequireDefault(require("ramda/src/path")); | ||
var _filter = _interopRequireDefault(require("ramda/src/filter")); | ||
var _utils = require("./utils"); | ||
@@ -24,3 +38,3 @@ | ||
} else if (typeof child === 'object') { | ||
return getText((0, _ramda.path)(['props', 'children'], child), value); | ||
return getText((0, _path.default)(['props', 'children'], child), value); | ||
} else { | ||
@@ -35,9 +49,9 @@ return "" + value + child; | ||
(0, _utils.checkReactElement)(element, toHaveTextContent, this); | ||
var textContent = (0, _ramda.compose)(_utils.normalize, (0, _ramda.join)(''), (0, _ramda.filter)(function (child) { | ||
var textContent = (0, _compose.default)(_utils.normalize, (0, _join.default)(''), (0, _filter.default)(function (child) { | ||
return typeof child === 'string' || typeof child === 'number'; | ||
}), (0, _ramda.map)(function (child) { | ||
}), (0, _map.default)(function (child) { | ||
return typeof child === 'object' ? getText(child) : child; | ||
}), function (child) { | ||
return (0, _ramda.is)(Array, child) ? child : [child]; | ||
}, (0, _ramda.defaultTo)([]), (0, _ramda.path)(['props', 'children']))(element); | ||
return (0, _is.default)(Array, child) ? child : [child]; | ||
}, (0, _defaultTo.default)([]), (0, _path.default)(['props', 'children']))(element); | ||
return { | ||
@@ -44,0 +58,0 @@ pass: (0, _utils.matches)(textContent, checkWith), |
{ | ||
"name": "@testing-library/jest-native", | ||
"version": "4.0.5", | ||
"version": "4.0.6", | ||
"description": "Custom jest matchers to test the state of React Native", | ||
@@ -35,3 +35,3 @@ "main": "dist/index.js", | ||
"pretty-format": "^27.3.1", | ||
"ramda": "^0.26.1", | ||
"ramda": "^0.28.0", | ||
"redent": "^2.0.0" | ||
@@ -38,0 +38,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38346
401
+ Addedramda@0.28.0(transitive)
- Removedramda@0.26.1(transitive)
Updatedramda@^0.28.0