jest-matchers
Advanced tools
Comparing version 19.2.0-alpha.993e64af to 19.3.0-alpha.85402254
@@ -11,3 +11,3 @@ /** | ||
'use strict';var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {return typeof obj;} : function (obj) {return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;};var _createClass = function () {function defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}return function (Constructor, protoProps, staticProps) {if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;};}();function _possibleConstructorReturn(self, call) {if (!self) {throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call && (typeof call === "object" || typeof call === "function") ? call : self;}function _inherits(subClass, superClass) {if (typeof superClass !== "function" && superClass !== null) {throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);}subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}var _require = | ||
'use strict';var _typeof2 = require('babel-runtime/helpers/typeof');var _typeof3 = _interopRequireDefault(_typeof2);var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);var _createClass2 = require('babel-runtime/helpers/createClass');var _createClass3 = _interopRequireDefault(_createClass2);var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);var _inherits2 = require('babel-runtime/helpers/inherits');var _inherits3 = _interopRequireDefault(_inherits2);var _for = require('babel-runtime/core-js/symbol/for');var _for2 = _interopRequireDefault(_for);var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}var _require = | ||
@@ -25,11 +25,11 @@ | ||
function AsymmetricMatcher() {_classCallCheck(this, AsymmetricMatcher); | ||
this.$$typeof = Symbol.for('jest.asymmetricMatcher'); | ||
function AsymmetricMatcher() {(0, _classCallCheck3.default)(this, AsymmetricMatcher); | ||
this.$$typeof = (0, _for2.default)('jest.asymmetricMatcher'); | ||
};var | ||
Any = function (_AsymmetricMatcher) {_inherits(Any, _AsymmetricMatcher); | ||
Any = function (_AsymmetricMatcher) {(0, _inherits3.default)(Any, _AsymmetricMatcher); | ||
function Any(sample) {_classCallCheck(this, Any);var _this = _possibleConstructorReturn(this, (Any.__proto__ || Object.getPrototypeOf(Any)).call(this)); | ||
function Any(sample) {(0, _classCallCheck3.default)(this, Any);var _this = (0, _possibleConstructorReturn3.default)(this, (Any.__proto__ || (0, _getPrototypeOf2.default)(Any)).call(this)); | ||
@@ -43,3 +43,3 @@ if (typeof sample === 'undefined') { | ||
_this.sample = sample;return _this; | ||
}_createClass(Any, [{ key: 'asymmetricMatch', value: function asymmetricMatch( | ||
}(0, _createClass3.default)(Any, [{ key: 'asymmetricMatch', value: function asymmetricMatch( | ||
@@ -60,3 +60,3 @@ other) { | ||
if (this.sample == Object) { | ||
return (typeof other === 'undefined' ? 'undefined' : _typeof(other)) == 'object'; | ||
return (typeof other === 'undefined' ? 'undefined' : (0, _typeof3.default)(other)) == 'object'; | ||
} | ||
@@ -104,3 +104,3 @@ | ||
Anything = function (_AsymmetricMatcher2) {_inherits(Anything, _AsymmetricMatcher2);function Anything() {_classCallCheck(this, Anything);return _possibleConstructorReturn(this, (Anything.__proto__ || Object.getPrototypeOf(Anything)).apply(this, arguments));}_createClass(Anything, [{ key: 'asymmetricMatch', value: function asymmetricMatch( | ||
Anything = function (_AsymmetricMatcher2) {(0, _inherits3.default)(Anything, _AsymmetricMatcher2);function Anything() {(0, _classCallCheck3.default)(this, Anything);return (0, _possibleConstructorReturn3.default)(this, (Anything.__proto__ || (0, _getPrototypeOf2.default)(Anything)).apply(this, arguments));}(0, _createClass3.default)(Anything, [{ key: 'asymmetricMatch', value: function asymmetricMatch( | ||
other) { | ||
@@ -121,9 +121,9 @@ return !isUndefined(other) && other !== null; | ||
ArrayContaining = function (_AsymmetricMatcher3) {_inherits(ArrayContaining, _AsymmetricMatcher3); | ||
ArrayContaining = function (_AsymmetricMatcher3) {(0, _inherits3.default)(ArrayContaining, _AsymmetricMatcher3); | ||
function ArrayContaining(sample) {_classCallCheck(this, ArrayContaining);var _this3 = _possibleConstructorReturn(this, (ArrayContaining.__proto__ || Object.getPrototypeOf(ArrayContaining)).call(this)); | ||
function ArrayContaining(sample) {(0, _classCallCheck3.default)(this, ArrayContaining);var _this3 = (0, _possibleConstructorReturn3.default)(this, (ArrayContaining.__proto__ || (0, _getPrototypeOf2.default)(ArrayContaining)).call(this)); | ||
_this3.sample = sample;return _this3; | ||
}_createClass(ArrayContaining, [{ key: 'asymmetricMatch', value: function asymmetricMatch( | ||
}(0, _createClass3.default)(ArrayContaining, [{ key: 'asymmetricMatch', value: function asymmetricMatch( | ||
@@ -133,3 +133,3 @@ other) { | ||
throw new Error( | ||
"You must provide an array to ArrayContaining, not '" + _typeof( | ||
"You must provide an array to ArrayContaining, not '" + (0, _typeof3.default)( | ||
this.sample) + | ||
@@ -156,14 +156,14 @@ "'."); | ||
ObjectContaining = function (_AsymmetricMatcher4) {_inherits(ObjectContaining, _AsymmetricMatcher4); | ||
ObjectContaining = function (_AsymmetricMatcher4) {(0, _inherits3.default)(ObjectContaining, _AsymmetricMatcher4); | ||
function ObjectContaining(sample) {_classCallCheck(this, ObjectContaining);var _this4 = _possibleConstructorReturn(this, (ObjectContaining.__proto__ || Object.getPrototypeOf(ObjectContaining)).call(this)); | ||
function ObjectContaining(sample) {(0, _classCallCheck3.default)(this, ObjectContaining);var _this4 = (0, _possibleConstructorReturn3.default)(this, (ObjectContaining.__proto__ || (0, _getPrototypeOf2.default)(ObjectContaining)).call(this)); | ||
_this4.sample = sample;return _this4; | ||
}_createClass(ObjectContaining, [{ key: 'asymmetricMatch', value: function asymmetricMatch( | ||
}(0, _createClass3.default)(ObjectContaining, [{ key: 'asymmetricMatch', value: function asymmetricMatch( | ||
other) { | ||
if (_typeof(this.sample) !== 'object') { | ||
if ((0, _typeof3.default)(this.sample) !== 'object') { | ||
throw new Error( | ||
"You must provide an object to ObjectContaining, not '" + _typeof( | ||
"You must provide an object to ObjectContaining, not '" + (0, _typeof3.default)( | ||
this.sample) + | ||
@@ -195,6 +195,6 @@ "'."); | ||
StringContaining = function (_AsymmetricMatcher5) {_inherits(StringContaining, _AsymmetricMatcher5); | ||
StringContaining = function (_AsymmetricMatcher5) {(0, _inherits3.default)(StringContaining, _AsymmetricMatcher5); | ||
function StringContaining(sample) {_classCallCheck(this, StringContaining);var _this5 = _possibleConstructorReturn(this, (StringContaining.__proto__ || Object.getPrototypeOf(StringContaining)).call(this)); | ||
function StringContaining(sample) {(0, _classCallCheck3.default)(this, StringContaining);var _this5 = (0, _possibleConstructorReturn3.default)(this, (StringContaining.__proto__ || (0, _getPrototypeOf2.default)(StringContaining)).call(this)); | ||
@@ -205,3 +205,3 @@ if (!isA('String', sample)) { | ||
_this5.sample = sample;return _this5; | ||
}_createClass(StringContaining, [{ key: 'asymmetricMatch', value: function asymmetricMatch( | ||
}(0, _createClass3.default)(StringContaining, [{ key: 'asymmetricMatch', value: function asymmetricMatch( | ||
@@ -221,6 +221,6 @@ other) { | ||
StringMatching = function (_AsymmetricMatcher6) {_inherits(StringMatching, _AsymmetricMatcher6); | ||
StringMatching = function (_AsymmetricMatcher6) {(0, _inherits3.default)(StringMatching, _AsymmetricMatcher6); | ||
function StringMatching(sample) {_classCallCheck(this, StringMatching);var _this6 = _possibleConstructorReturn(this, (StringMatching.__proto__ || Object.getPrototypeOf(StringMatching)).call(this)); | ||
function StringMatching(sample) {(0, _classCallCheck3.default)(this, StringMatching);var _this6 = (0, _possibleConstructorReturn3.default)(this, (StringMatching.__proto__ || (0, _getPrototypeOf2.default)(StringMatching)).call(this)); | ||
@@ -232,3 +232,3 @@ if (!isA('String', sample) && !isA('RegExp', sample)) { | ||
_this6.sample = new RegExp(sample);return _this6; | ||
}_createClass(StringMatching, [{ key: 'asymmetricMatch', value: function asymmetricMatch( | ||
}(0, _createClass3.default)(StringMatching, [{ key: 'asymmetricMatch', value: function asymmetricMatch( | ||
@@ -235,0 +235,0 @@ other) { |
@@ -11,3 +11,3 @@ /** | ||
'use strict';var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {return typeof obj;} : function (obj) {return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;};function _asyncToGenerator(fn) {return function () {var gen = fn.apply(this, arguments);return new Promise(function (resolve, reject) {function step(key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {return Promise.resolve(value).then(function (value) {step("next", value);}, function (err) {step("throw", err);});}}return step("next");});};}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self, call) {if (!self) {throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call && (typeof call === "object" || typeof call === "function") ? call : self;}function _inherits(subClass, superClass) {if (typeof superClass !== "function" && superClass !== null) {throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);}subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;} | ||
'use strict';var _assign = require('babel-runtime/core-js/object/assign');var _assign2 = _interopRequireDefault(_assign);var _regenerator = require('babel-runtime/regenerator');var _regenerator2 = _interopRequireDefault(_regenerator);var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator');var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);var _keys = require('babel-runtime/core-js/object/keys');var _keys2 = _interopRequireDefault(_keys);var _create = require('babel-runtime/core-js/object/create');var _create2 = _interopRequireDefault(_create);var _defineProperty = require('babel-runtime/core-js/object/define-property');var _defineProperty2 = _interopRequireDefault(_defineProperty);var _typeof2 = require('babel-runtime/helpers/typeof');var _typeof3 = _interopRequireDefault(_typeof2);var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);var _inherits2 = require('babel-runtime/helpers/inherits');var _inherits3 = _interopRequireDefault(_inherits2);var _for = require('babel-runtime/core-js/symbol/for');var _for2 = _interopRequireDefault(_for);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} | ||
@@ -27,5 +27,6 @@ | ||
var spyMatchers = require('./spyMatchers'); | ||
var toThrowMatchers = require('./toThrowMatchers'); | ||
var toThrowMatchers = require('./toThrowMatchers');var _require = | ||
require('./jasmine-utils'),equals = _require.equals; | ||
var utils = require('jest-matcher-utils');var _require2 = | ||
var utils = require('jest-matcher-utils');var _require = | ||
@@ -37,15 +38,14 @@ | ||
require('./asymmetric-matchers'),any = _require2.any,anything = _require2.anything,arrayContaining = _require2.arrayContaining,objectContaining = _require2.objectContaining,stringContaining = _require2.stringContaining,stringMatching = _require2.stringMatching; | ||
require('./asymmetric-matchers'),any = _require.any,anything = _require.anything,arrayContaining = _require.arrayContaining,objectContaining = _require.objectContaining,stringContaining = _require.stringContaining,stringMatching = _require.stringMatching; | ||
var GLOBAL_STATE = (0, _for2.default)('$$jest-matchers-object');var | ||
var GLOBAL_STATE = Symbol.for('$$jest-matchers-object');var | ||
JestAssertionError = function (_Error) {(0, _inherits3.default)(JestAssertionError, _Error);function JestAssertionError() {(0, _classCallCheck3.default)(this, JestAssertionError);return (0, _possibleConstructorReturn3.default)(this, (JestAssertionError.__proto__ || (0, _getPrototypeOf2.default)(JestAssertionError)).apply(this, arguments));}return JestAssertionError;}(Error); | ||
JestAssertionError = function (_Error) {_inherits(JestAssertionError, _Error);function JestAssertionError() {_classCallCheck(this, JestAssertionError);return _possibleConstructorReturn(this, (JestAssertionError.__proto__ || Object.getPrototypeOf(JestAssertionError)).apply(this, arguments));}return JestAssertionError;}(Error); | ||
var isPromise = function isPromise(obj) { | ||
return ( | ||
!!obj && ( | ||
(typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' || typeof obj === 'function') && | ||
(typeof obj === 'undefined' ? 'undefined' : (0, _typeof3.default)(obj)) === 'object' || typeof obj === 'function') && | ||
typeof obj.then === 'function'); | ||
@@ -56,5 +56,5 @@ | ||
if (!global[GLOBAL_STATE]) { | ||
Object.defineProperty(global, GLOBAL_STATE, { | ||
(0, _defineProperty2.default)(global, GLOBAL_STATE, { | ||
value: { | ||
matchers: Object.create(null), | ||
matchers: (0, _create2.default)(null), | ||
state: { | ||
@@ -78,3 +78,3 @@ assertionCalls: 0, | ||
Object.keys(allMatchers).forEach(function (name) { | ||
(0, _keys2.default)(allMatchers).forEach(function (name) { | ||
expectation[name] = makeThrowingMatcher(allMatchers[name], false, actual); | ||
@@ -136,4 +136,4 @@ expectation.not[name] = makeThrowingMatcher( | ||
isNot, | ||
actual) {return _asyncToGenerator(regeneratorRuntime.mark( | ||
function _callee() {for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {args[_key] = arguments[_key];}var matcherStatement, result;return regeneratorRuntime.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0: | ||
actual) {return (0, _asyncToGenerator3.default)(_regenerator2.default.mark( | ||
function _callee() {for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {args[_key] = arguments[_key];}var matcherStatement, result;return _regenerator2.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0: | ||
matcherStatement = '.resolves.' + (isNot ? 'not.' : '') + matcherName;if ( | ||
@@ -168,4 +168,4 @@ isPromise(actual)) {_context.next = 3;break;}throw ( | ||
isNot, | ||
actual) {return _asyncToGenerator(regeneratorRuntime.mark( | ||
function _callee2() {for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {args[_key2] = arguments[_key2];}var matcherStatement, result;return regeneratorRuntime.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0: | ||
actual) {return (0, _asyncToGenerator3.default)(_regenerator2.default.mark( | ||
function _callee2() {for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {args[_key2] = arguments[_key2];}var matcherStatement, result;return _regenerator2.default.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0: | ||
matcherStatement = '.rejects.' + (isNot ? 'not.' : '') + matcherName;if ( | ||
@@ -204,3 +204,3 @@ isPromise(actual)) {_context2.next = 3;break;}throw ( | ||
var throws = true; | ||
var matcherContext = Object.assign( | ||
var matcherContext = (0, _assign2.default)( | ||
// When throws is disabled, the matcher will not throw errors during test | ||
@@ -214,2 +214,3 @@ // execution but instead add them to the global matcher state. If a | ||
{ | ||
equals: equals, | ||
isNot: isNot, | ||
@@ -253,4 +254,4 @@ utils: utils }); | ||
expect.extend = function (matchersObj) { | ||
Object.assign(global[GLOBAL_STATE].matchers, matchersObj); | ||
expect.extend = function (matchers) { | ||
(0, _assign2.default)(global[GLOBAL_STATE].matchers, matchers); | ||
}; | ||
@@ -267,3 +268,3 @@ | ||
if ( | ||
(typeof result === 'undefined' ? 'undefined' : _typeof(result)) !== 'object' || | ||
(typeof result === 'undefined' ? 'undefined' : (0, _typeof3.default)(result)) !== 'object' || | ||
typeof result.pass !== 'boolean' || | ||
@@ -297,3 +298,3 @@ result.message && | ||
expect.setState = function (state) { | ||
Object.assign(global[GLOBAL_STATE].state, state); | ||
(0, _assign2.default)(global[GLOBAL_STATE].state, state); | ||
}; | ||
@@ -300,0 +301,0 @@ expect.getState = function () {return global[GLOBAL_STATE].state;}; |
@@ -29,3 +29,3 @@ /* | ||
// Extracted out of jasmine 2.5.2 | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {return typeof obj;} : function (obj) {return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;};function equals(a, b, customTesters) { | ||
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);var _typeof2 = require('babel-runtime/helpers/typeof');var _typeof3 = _interopRequireDefault(_typeof2);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function equals(a, b, customTesters) { | ||
customTesters = customTesters || []; | ||
@@ -114,3 +114,3 @@ return eq(a, b, [], [], customTesters); | ||
if ((typeof a === 'undefined' ? 'undefined' : _typeof(a)) != 'object' || (typeof b === 'undefined' ? 'undefined' : _typeof(b)) != 'object') { | ||
if ((typeof a === 'undefined' ? 'undefined' : (0, _typeof3.default)(a)) != 'object' || (typeof b === 'undefined' ? 'undefined' : (0, _typeof3.default)(b)) != 'object') { | ||
return false; | ||
@@ -269,4 +269,4 @@ } | ||
function getPrototype(obj) { | ||
if (Object.getPrototypeOf) { | ||
return Object.getPrototypeOf(obj); | ||
if (_getPrototypeOf2.default) { | ||
return (0, _getPrototypeOf2.default)(obj); | ||
} | ||
@@ -273,0 +273,0 @@ |
@@ -12,3 +12,3 @@ /** | ||
'use strict';var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {return typeof obj;} : function (obj) {return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;}; | ||
'use strict';var _from = require('babel-runtime/core-js/array/from');var _from2 = _interopRequireDefault(_from);var _isNan = require('babel-runtime/core-js/number/is-nan');var _isNan2 = _interopRequireDefault(_isNan);var _keys = require('babel-runtime/core-js/object/keys');var _keys2 = _interopRequireDefault(_keys);var _getIterator2 = require('babel-runtime/core-js/get-iterator');var _getIterator3 = _interopRequireDefault(_getIterator2);var _typeof2 = require('babel-runtime/helpers/typeof');var _typeof3 = _interopRequireDefault(_typeof2);var _iterator2 = require('babel-runtime/core-js/symbol/iterator');var _iterator3 = _interopRequireDefault(_iterator2);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} | ||
@@ -40,3 +40,3 @@ | ||
var IteratorSymbol = Symbol.iterator; | ||
var IteratorSymbol = _iterator3.default; | ||
@@ -46,4 +46,4 @@ var hasIterator = function hasIterator(object) {return !!(object != null && object[IteratorSymbol]);}; | ||
if ( | ||
(typeof a === 'undefined' ? 'undefined' : _typeof(a)) !== 'object' || | ||
(typeof b === 'undefined' ? 'undefined' : _typeof(b)) !== 'object' || | ||
(typeof a === 'undefined' ? 'undefined' : (0, _typeof3.default)(a)) !== 'object' || | ||
(typeof b === 'undefined' ? 'undefined' : (0, _typeof3.default)(b)) !== 'object' || | ||
Array.isArray(a) || | ||
@@ -61,3 +61,3 @@ Array.isArray(b) || | ||
for (var _iterator = a[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {var aValue = _step.value; | ||
for (var _iterator = (0, _getIterator3.default)(a), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {var aValue = _step.value; | ||
var nextB = bIterator.next(); | ||
@@ -75,3 +75,3 @@ if (nextB.done || !equals(aValue, nextB.value, [iterableEquality])) { | ||
a !== null && | ||
(typeof a === 'undefined' ? 'undefined' : _typeof(a)) === 'object' && | ||
(typeof a === 'undefined' ? 'undefined' : (0, _typeof3.default)(a)) === 'object' && | ||
!(a instanceof Array) && | ||
@@ -83,3 +83,3 @@ !(a instanceof Date));}; | ||
} | ||
return Object.keys(subset).every( | ||
return (0, _keys2.default)(subset).every( | ||
function (key) {return ( | ||
@@ -300,3 +300,3 @@ hasOwnProperty(object, key) && | ||
ensureNoExpected(expected, '.toBeNaN'); | ||
var pass = Number.isNaN(actual); | ||
var pass = (0, _isNan2.default)(actual); | ||
var message = pass ? | ||
@@ -378,3 +378,3 @@ function () {return ( | ||
try { | ||
converted = Array.from(collection); | ||
converted = (0, _from2.default)(collection); | ||
} catch (e) { | ||
@@ -418,3 +418,3 @@ throw new Error( | ||
try { | ||
converted = Array.from(collection); | ||
converted = (0, _from2.default)(collection); | ||
} catch (e) { | ||
@@ -642,3 +642,3 @@ throw new Error( | ||
toMatchObject: function toMatchObject(receivedObject, expectedObject) {var _this3 = this; | ||
if ((typeof receivedObject === 'undefined' ? 'undefined' : _typeof(receivedObject)) !== 'object' || receivedObject === null) { | ||
if ((typeof receivedObject === 'undefined' ? 'undefined' : (0, _typeof3.default)(receivedObject)) !== 'object' || receivedObject === null) { | ||
throw new Error( | ||
@@ -652,3 +652,3 @@ matcherHint('[.not].toMatchObject', 'object', 'expected') + | ||
if ((typeof expectedObject === 'undefined' ? 'undefined' : _typeof(expectedObject)) !== 'object' || expectedObject === null) { | ||
if ((typeof expectedObject === 'undefined' ? 'undefined' : (0, _typeof3.default)(expectedObject)) !== 'object' || expectedObject === null) { | ||
throw new Error( | ||
@@ -655,0 +655,0 @@ matcherHint('[.not].toMatchObject', 'object', 'expected') + |
@@ -12,3 +12,3 @@ /** | ||
'use strict';var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {return typeof obj;} : function (obj) {return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;};var _require = | ||
'use strict';var _typeof2 = require('babel-runtime/helpers/typeof');var _typeof3 = _interopRequireDefault(_typeof2);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}var _require = | ||
@@ -63,3 +63,3 @@ | ||
return toThrowMatchingStringOrRegexp(matcherName, error, expected, value); | ||
} else if (expected && (typeof expected === 'undefined' ? 'undefined' : _typeof(expected)) === 'object') { | ||
} else if (expected && (typeof expected === 'undefined' ? 'undefined' : (0, _typeof3.default)(expected)) === 'object') { | ||
return toThrowMatchingErrorInstance(matcherName, error, expected); | ||
@@ -66,0 +66,0 @@ } else if (expected === undefined) { |
@@ -11,3 +11,3 @@ /** | ||
'use strict';var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {return typeof obj;} : function (obj) {return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;}; | ||
'use strict';var _keys = require('babel-runtime/core-js/object/keys');var _keys2 = _interopRequireDefault(_keys);var _typeof2 = require('babel-runtime/helpers/typeof');var _typeof3 = _interopRequireDefault(_typeof2);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} | ||
@@ -78,9 +78,9 @@ | ||
} else if ( | ||
(typeof object === 'undefined' ? 'undefined' : _typeof(object)) === 'object' && | ||
(typeof object === 'undefined' ? 'undefined' : (0, _typeof3.default)(object)) === 'object' && | ||
object !== null && | ||
(typeof subset === 'undefined' ? 'undefined' : _typeof(subset)) === 'object' && | ||
(typeof subset === 'undefined' ? 'undefined' : (0, _typeof3.default)(subset)) === 'object' && | ||
subset !== null) | ||
{ | ||
var trimmed = {}; | ||
Object.keys(subset). | ||
(0, _keys2.default)(subset). | ||
filter(function (key) {return object.hasOwnProperty(key);}). | ||
@@ -91,3 +91,3 @@ forEach( | ||
if (Object.keys(trimmed).length > 0) { | ||
if ((0, _keys2.default)(trimmed).length > 0) { | ||
return trimmed; | ||
@@ -94,0 +94,0 @@ } |
@@ -26,5 +26,6 @@ /** | ||
const spyMatchers = require('./spyMatchers'); | ||
const toThrowMatchers = require('./toThrowMatchers'); | ||
const toThrowMatchers = require('./toThrowMatchers');var _require = | ||
require('./jasmine-utils');const equals = _require.equals; | ||
const utils = require('jest-matcher-utils');var _require2 = | ||
const utils = require('jest-matcher-utils');var _require = | ||
@@ -36,5 +37,4 @@ | ||
require('./asymmetric-matchers');const any = _require2.any,anything = _require2.anything,arrayContaining = _require2.arrayContaining,objectContaining = _require2.objectContaining,stringContaining = _require2.stringContaining,stringMatching = _require2.stringMatching; | ||
require('./asymmetric-matchers');const any = _require.any,anything = _require.anything,arrayContaining = _require.arrayContaining,objectContaining = _require.objectContaining,stringContaining = _require.stringContaining,stringMatching = _require.stringMatching; | ||
const GLOBAL_STATE = Symbol.for('$$jest-matchers-object'); | ||
@@ -208,2 +208,3 @@ | ||
{ | ||
equals, | ||
isNot, | ||
@@ -247,4 +248,4 @@ utils }); | ||
expect.extend = matchersObj => { | ||
Object.assign(global[GLOBAL_STATE].matchers, matchersObj); | ||
expect.extend = matchers => { | ||
Object.assign(global[GLOBAL_STATE].matchers, matchers); | ||
}; | ||
@@ -251,0 +252,0 @@ |
{ | ||
"name": "jest-matchers", | ||
"version": "19.2.0-alpha.993e64af", | ||
"version": "19.3.0-alpha.85402254", | ||
"repository": { | ||
@@ -12,7 +12,7 @@ "type": "git", | ||
"dependencies": { | ||
"jest-diff": "^19.2.0-alpha.993e64af", | ||
"jest-matcher-utils": "^19.2.0-alpha.993e64af", | ||
"jest-message-util": "^19.2.0-alpha.993e64af", | ||
"jest-regex-util": "^19.2.0-alpha.993e64af" | ||
"jest-diff": "^19.3.0-alpha.85402254", | ||
"jest-matcher-utils": "^19.3.0-alpha.85402254", | ||
"jest-message-util": "^19.3.0-alpha.85402254", | ||
"jest-regex-util": "^19.3.0-alpha.85402254" | ||
} | ||
} |
126336
3152
+ Addedjest-diff@19.3.0-alpha.85402254(transitive)
+ Addedjest-matcher-utils@19.3.0-alpha.85402254(transitive)
+ Addedjest-message-util@19.3.0-alpha.85402254(transitive)
+ Addedjest-regex-util@19.3.0-alpha.85402254(transitive)
+ Addedpretty-format@19.3.0-alpha.85402254(transitive)
- Removedjest-diff@19.2.0-alpha.993e64af(transitive)
- Removedjest-matcher-utils@19.2.0-alpha.993e64af(transitive)
- Removedjest-message-util@19.2.0-alpha.993e64af(transitive)
- Removedjest-regex-util@19.2.0-alpha.993e64af(transitive)
- Removedpretty-format@19.2.0-alpha.993e64af(transitive)