Comparing version 22.0.3 to 22.0.5
@@ -196,2 +196,6 @@ 'use strict';Object.defineProperty(exports, "__esModule", { value: true });exports.stringMatching = exports.stringContaining = exports.objectContaining = exports.arrayContaining = exports.anything = exports.any = undefined; | ||
asymmetricMatch(other) { | ||
if (!(0, _jasmine_utils.isA)('String', other)) { | ||
return false; | ||
} | ||
return other.includes(this.sample); | ||
@@ -222,2 +226,6 @@ } | ||
asymmetricMatch(other) { | ||
if (!(0, _jasmine_utils.isA)('String', other)) { | ||
return false; | ||
} | ||
return this.sample.test(other); | ||
@@ -224,0 +232,0 @@ } |
@@ -42,2 +42,3 @@ 'use strict'; | ||
var _extract_expected_assertions_errors = require('./extract_expected_assertions_errors');var _extract_expected_assertions_errors2 = _interopRequireDefault(_extract_expected_assertions_errors);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function _interopRequireWildcard(obj) {if (obj && obj.__esModule) {return obj;} else {var newObj = {};if (obj != null) {for (var key in obj) {if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];}}newObj.default = obj;return newObj;}}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");});};} /** | ||
@@ -218,2 +219,3 @@ * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. | ||
if ( | ||
matcher[_jest_matchers_object.INTERNAL_MATCHER_FLAG] === true && | ||
!(error instanceof JestAssertionError) && | ||
@@ -257,3 +259,4 @@ error.name !== 'PrettyFormatPluginError' && | ||
expect.extend = matchers => (0, _jest_matchers_object.setMatchers)(matchers); | ||
expect.extend = matchers => | ||
(0, _jest_matchers_object.setMatchers)(matchers, false); | ||
@@ -286,5 +289,5 @@ expect.anything = _asymmetric_matchers.anything; | ||
// add default jest matchers | ||
expect.extend(_matchers2.default); | ||
expect.extend(_spy_matchers2.default); | ||
expect.extend(_to_throw_matchers2.default); | ||
(0, _jest_matchers_object.setMatchers)(_matchers2.default, true); | ||
(0, _jest_matchers_object.setMatchers)(_spy_matchers2.default, true); | ||
(0, _jest_matchers_object.setMatchers)(_to_throw_matchers2.default, true); | ||
@@ -291,0 +294,0 @@ expect.addSnapshotSerializer = () => void 0; |
@@ -14,10 +14,14 @@ 'use strict';Object.defineProperty(exports, "__esModule", { value: true }); | ||
// the state, that can hold matcher specific values that change over time. | ||
const JEST_MATCHERS_OBJECT = Symbol.for('$$jest-matchers-object'); /** | ||
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* | ||
*/if (!global[JEST_MATCHERS_OBJECT]) {Object.defineProperty(global, JEST_MATCHERS_OBJECT, { value: { matchers: Object.create(null), state: { assertionCalls: 0, | ||
const JEST_MATCHERS_OBJECT = Symbol.for('$$jest-matchers-object'); | ||
// Notes a built-in/internal Jest matcher. | ||
// Jest may override the stack trace of Errors thrown by internal matchers. | ||
/** | ||
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* | ||
*/const INTERNAL_MATCHER_FLAG = exports.INTERNAL_MATCHER_FLAG = Symbol.for('$$jest-internal-matcher');if (!global[JEST_MATCHERS_OBJECT]) {Object.defineProperty(global, JEST_MATCHERS_OBJECT, { value: { matchers: Object.create(null), state: { assertionCalls: 0, | ||
expectedAssertionsNumber: null, | ||
@@ -39,4 +43,11 @@ isExpectingAssertions: false, | ||
const setMatchers = exports.setMatchers = matchers => { | ||
const setMatchers = exports.setMatchers = (matchers, isInternal) => { | ||
Object.keys(matchers).forEach(key => { | ||
const matcher = matchers[key]; | ||
Object.defineProperty(matcher, INTERNAL_MATCHER_FLAG, { | ||
value: isInternal }); | ||
}); | ||
Object.assign(global[JEST_MATCHERS_OBJECT].matchers, matchers); | ||
}; |
@@ -503,3 +503,5 @@ 'use strict';Object.defineProperty(exports, "__esModule", { value: true }); | ||
if ((0, _jestGetType2.default)(keyPath) !== 'string') { | ||
const keyPathType = (0, _jestGetType2.default)(keyPath); | ||
if (keyPathType !== 'string' && keyPathType !== 'array') { | ||
throw new Error( | ||
@@ -510,3 +512,5 @@ (0, _jestMatcherUtils.matcherHint)('[.not].toHaveProperty', 'object', 'path', { | ||
'\n\n' + | ||
`Expected ${(0, _jestMatcherUtils.EXPECTED_COLOR)('path')} to be a string. Received:\n` + | ||
`Expected ${(0, _jestMatcherUtils.EXPECTED_COLOR)( | ||
'path') | ||
} to be a string or an array. Received:\n` + | ||
` ${(0, _jestGetType2.default)(keyPath)}: ${(0, _jestMatcherUtils.printReceived)(keyPath)}`); | ||
@@ -513,0 +517,0 @@ |
{ | ||
"name": "expect", | ||
"version": "22.0.3", | ||
"version": "22.0.5", | ||
"repository": { | ||
@@ -13,8 +13,8 @@ "type": "git", | ||
"ansi-styles": "^3.2.0", | ||
"jest-diff": "^22.0.3", | ||
"jest-diff": "^22.0.5", | ||
"jest-get-type": "^22.0.3", | ||
"jest-matcher-utils": "^22.0.3", | ||
"jest-matcher-utils": "^22.0.5", | ||
"jest-message-util": "^22.0.3", | ||
"jest-regex-util": "^22.0.3" | ||
"jest-regex-util": "^22.0.5" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
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
567562
14351
Updatedjest-diff@^22.0.5
Updatedjest-matcher-utils@^22.0.5
Updatedjest-regex-util@^22.0.5