Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

expect

Package Overview
Dependencies
Maintainers
6
Versions
237
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

expect - npm Package Compare versions

Comparing version 21.1.0 to 21.2.0

11

build/asymmetric_matchers.js

@@ -10,3 +10,2 @@ 'use strict';Object.defineProperty(exports, "__esModule", { value: true });exports.stringMatching = exports.stringContaining = exports.objectContaining = exports.arrayContaining = exports.anything = exports.any = undefined;

var _jasmine_utils = require('./jasmine_utils');

@@ -26,10 +25,10 @@

}} /**
* Copyright (c) 2014, Facebook, Inc. All rights reserved.
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/class Any extends AsymmetricMatcher {constructor(sample) {super();if (typeof sample === 'undefined') {
*/class Any extends AsymmetricMatcher {constructor(sample) {super();
if (typeof sample === 'undefined') {
throw new TypeError(

@@ -36,0 +35,0 @@ 'any() expects to be passed a constructor function. ' +

@@ -10,3 +10,2 @@ 'use strict';Object.defineProperty(exports, "__esModule", { value: true });

var _jestMatcherUtils = require('jest-matcher-utils');

@@ -19,15 +18,25 @@

var _jest_matchers_object = require('./jest_matchers_object');
var _jest_matchers_object = require('./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.
*
*
*/const resetAssertionsLocalState = () => {(0, _jest_matchers_object.setState)({ assertionCalls: 0, expectedAssertionsNumber: null, isExpectingAssertions: false });
};
// Create and format all errors related to the mismatched number of `expect`
// calls and reset the matchers state.
/**
* Copyright (c) 2014, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/const extractExpectedAssertionsErrors = () => {const result = [];var _getState = (0, _jest_matchers_object.getState)();const assertionCalls = _getState.assertionCalls,expectedAssertionsNumber = _getState.expectedAssertionsNumber,isExpectingAssertions = _getState.isExpectingAssertions;(0, _jest_matchers_object.setState)({ assertionCalls: 0, expectedAssertionsNumber: null });if (
const extractExpectedAssertionsErrors = () => {
const result = [];var _getState =
(0, _jest_matchers_object.getState)();const assertionCalls = _getState.assertionCalls,expectedAssertionsNumber = _getState.expectedAssertionsNumber,isExpectingAssertions = _getState.isExpectingAssertions;
resetAssertionsLocalState();
if (
typeof expectedAssertionsNumber === 'number' &&

@@ -34,0 +43,0 @@ assertionCalls !== expectedAssertionsNumber)

@@ -9,13 +9,12 @@ 'use strict';

var _ansiStyles = require('ansi-styles');var _ansiStyles2 = _interopRequireDefault(_ansiStyles);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
const returnInput = str => str; /**
* Copyright (c) 2014, Facebook, Inc. All rights reserved.
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/const allColorsAsFunc = Object.keys(_ansiStyles2.default).map(style => ({ [style]: returnInput })).reduce((acc, cur) => Object.assign(acc, cur));Object.keys(allColorsAsFunc).map(color => allColorsAsFunc[color]).
*/const allColorsAsFunc = Object.keys(_ansiStyles2.default).map(style => ({ [style]: returnInput })).reduce((acc, cur) => Object.assign(acc, cur));Object.keys(allColorsAsFunc).
map(color => allColorsAsFunc[color]).
forEach(style => {

@@ -22,0 +21,0 @@ Object.assign(style, allColorsAsFunc);

@@ -21,3 +21,2 @@ 'use strict';

var _jestMatcherUtils = require('jest-matcher-utils');var utils = _interopRequireWildcard(_jestMatcherUtils);

@@ -43,12 +42,12 @@ var _matchers = require('./matchers');var _matchers2 = _interopRequireDefault(_matchers);

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");});};} /**
* Copyright (c) 2014, Facebook, Inc. All rights reserved.
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/class JestAssertionError extends Error {}const isPromise = obj => {return !!obj && (
typeof obj === 'object' || typeof obj === 'function') &&
typeof obj.then === 'function';
*/class JestAssertionError extends Error {}const isPromise = obj => {return (
!!obj && (
typeof obj === 'object' || typeof obj === 'function') &&
typeof obj.then === 'function');

@@ -203,6 +202,8 @@ };

} catch (error) {
// Try to remove this and deeper functions from the stack trace frame.
// Guard for some environments (browsers) that do not support this feature.
if (Error.captureStackTrace) {
Error.captureStackTrace(error, throwingMatcher);
if (!(error instanceof JestAssertionError)) {
// Try to remove this and deeper functions from the stack trace frame.
// Guard for some environments (browsers) that do not support this feature.
if (Error.captureStackTrace) {
Error.captureStackTrace(error, throwingMatcher);
}
}

@@ -209,0 +210,0 @@ throw error;

@@ -12,14 +12,13 @@ 'use strict';Object.defineProperty(exports, "__esModule", { value: true });

// Global matchers object holds the list of available matchers and
// the state, that can hold matcher specific values that change over time.
const JEST_MATCHERS_OBJECT = Symbol.for('$$jest-matchers-object'); /**
* Copyright (c) 2014, Facebook, Inc. All rights reserved.
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
* 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, expectedAssertionsNumber: null,
*/if (!global[JEST_MATCHERS_OBJECT]) {Object.defineProperty(global, JEST_MATCHERS_OBJECT, { value: { matchers: Object.create(null), state: { assertionCalls: 0,
expectedAssertionsNumber: null,
isExpectingAssertions: false,

@@ -26,0 +25,0 @@ suppressedErrors: [] // errors that are not thrown immediately.

@@ -12,3 +12,2 @@ 'use strict';Object.defineProperty(exports, "__esModule", { value: true });

var _jestDiff = require('jest-diff');var _jestDiff2 = _interopRequireDefault(_jestDiff);

@@ -663,9 +662,8 @@ var _jestGetType = require('jest-get-type');var _jestGetType2 = _interopRequireDefault(_jestGetType);

} }; /**
* Copyright (c) 2014, Facebook, Inc. All rights reserved.
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/exports.default = matchers;

@@ -14,3 +14,2 @@ 'use strict';Object.defineProperty(exports, "__esModule", { value: true });var _slicedToArray = function () {function sliceIterator(arr, i) {var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"]) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}return function (arr, i) {if (Array.isArray(arr)) {return arr;} else if (Symbol.iterator in Object(arr)) {return sliceIterator(arr, i);} else {throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}();

var _jestMatcherUtils = require('jest-matcher-utils');

@@ -29,10 +28,10 @@

var _utils = require('./utils');const CALL_PRINT_LIMIT = 3; /**
* Copyright (c) 2014, Facebook, Inc. All rights reserved.
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/const LAST_CALL_PRINT_LIMIT = 1;const RECEIVED_NAME = { 'mock function': 'jest.fn()', spy: 'spy' };const createToBeCalledMatcher = matcherName => (received, expected) => {(0, _jestMatcherUtils.ensureNoExpected)(expected, matcherName);
*/const LAST_CALL_PRINT_LIMIT = 1;const RECEIVED_NAME = { 'mock function': 'jest.fn()', spy: 'spy' };const createToBeCalledMatcher = matcherName => (received, expected) => {
(0, _jestMatcherUtils.ensureNoExpected)(expected, matcherName);
ensureMock(received, matcherName);

@@ -39,0 +38,0 @@

@@ -12,3 +12,2 @@ 'use strict';Object.defineProperty(exports, "__esModule", { value: true });

var _jestGetType = require('jest-get-type');var _jestGetType2 = _interopRequireDefault(_jestGetType);

@@ -26,10 +25,10 @@ var _jestRegexUtil = require('jest-regex-util');

var _jasmine_utils = require('./jasmine_utils');function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} /**
* Copyright (c) 2014, Facebook, Inc. All rights reserved.
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/const createMatcher = matcherName => (actual, expected) => {const value = expected;let error;
if (typeof actual !== 'function') {

@@ -36,0 +35,0 @@ throw new Error(

@@ -10,3 +10,2 @@ 'use strict';Object.defineProperty(exports, "__esModule", { value: true });exports.partition = exports.subsetEquality = exports.iterableEquality = exports.getObjectSubset = exports.getPath = exports.hasOwnProperty = undefined;

var _jasmine_utils = require('./jasmine_utils');

@@ -23,10 +22,10 @@

Object.prototype.hasOwnProperty.call(object, value); /**
* Copyright (c) 2014, Facebook, Inc. All rights reserved.
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/const getPath = exports.getPath = (object, propertyPath) => {if (!Array.isArray(propertyPath)) {propertyPath = propertyPath.split('.');}
*/const getPath = exports.getPath = (object, propertyPath) => {if (!Array.isArray(propertyPath)) {propertyPath = propertyPath.split('.');
}

@@ -33,0 +32,0 @@ const lastProp = propertyPath.length === 1;

{
"name": "expect",
"version": "21.1.0",
"version": "21.2.0",
"repository": {

@@ -8,3 +8,3 @@ "type": "git",

},
"license": "BSD-3-Clause",
"license": "MIT",
"main": "build/index.js",

@@ -14,8 +14,8 @@ "browser": "build-es5/index.js",

"ansi-styles": "^3.2.0",
"jest-diff": "^21.1.0",
"jest-get-type": "^21.0.2",
"jest-matcher-utils": "^21.1.0",
"jest-message-util": "^21.1.0",
"jest-regex-util": "^21.1.0"
"jest-diff": "^21.2.0",
"jest-get-type": "^21.2.0",
"jest-matcher-utils": "^21.2.0",
"jest-message-util": "^21.2.0",
"jest-regex-util": "^21.2.0"
}
}

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