Socket
Socket
Sign inDemoInstall

expect

Package Overview
Dependencies
Maintainers
7
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.3.0-beta.1 to 21.3.0-beta.2

31

build/spy_matchers.js

@@ -33,8 +33,4 @@ '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");}};}();

*
*/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);
const receivedIsSpy = isSpy(received);
const type = receivedIsSpy ? 'spy' : 'mock function';
*/const LAST_CALL_PRINT_LIMIT = 1;const createToBeCalledMatcher = matcherName => (received, expected) => {(0, _jestMatcherUtils.ensureNoExpected)(expected, matcherName);ensureMock(received, matcherName);const receivedIsSpy = isSpy(received);const type = receivedIsSpy ? 'spy' : 'mock function';
const receivedName = receivedIsSpy ? 'spy' : received.getMockName();
const count = receivedIsSpy ?

@@ -49,3 +45,3 @@ received.calls.count() :

() =>
(0, _jestMatcherUtils.matcherHint)('.not' + matcherName, RECEIVED_NAME[type], '') +
(0, _jestMatcherUtils.matcherHint)('.not' + matcherName, receivedName, '') +
'\n\n' +

@@ -55,3 +51,3 @@ `Expected ${type} not to be called ` +

() =>
(0, _jestMatcherUtils.matcherHint)(matcherName, RECEIVED_NAME[type], '') +
(0, _jestMatcherUtils.matcherHint)(matcherName, receivedName, '') +
'\n\n' +

@@ -71,2 +67,3 @@ `Expected ${type} to have been called.`;

const type = receivedIsSpy ? 'spy' : 'mock function';
const receivedName = receivedIsSpy ? 'spy' : received.getMockName();
const calls = receivedIsSpy ?

@@ -83,3 +80,3 @@ received.calls.all().map(x => x.args) :

() =>
(0, _jestMatcherUtils.matcherHint)('.not' + matcherName, RECEIVED_NAME[type]) +
(0, _jestMatcherUtils.matcherHint)('.not' + matcherName, receivedName) +
'\n\n' +

@@ -89,3 +86,3 @@ `Expected ${type} not to have been called with:\n` +

() =>
(0, _jestMatcherUtils.matcherHint)(matcherName, RECEIVED_NAME[type]) +
(0, _jestMatcherUtils.matcherHint)(matcherName, receivedName) +
'\n\n' +

@@ -106,2 +103,3 @@ `Expected ${type} to have been called with:\n` +

const type = receivedIsSpy ? 'spy' : 'mock function';
const receivedName = receivedIsSpy ? 'spy' : received.getMockName();
const calls = receivedIsSpy ?

@@ -114,3 +112,3 @@ received.calls.all().map(x => x.args) :

() =>
(0, _jestMatcherUtils.matcherHint)('.not' + matcherName, RECEIVED_NAME[type]) +
(0, _jestMatcherUtils.matcherHint)('.not' + matcherName, receivedName) +
'\n\n' +

@@ -120,3 +118,3 @@ `Expected ${type} to not have been last called with:\n` +

() =>
(0, _jestMatcherUtils.matcherHint)(matcherName, RECEIVED_NAME[type]) +
(0, _jestMatcherUtils.matcherHint)(matcherName, receivedName) +
'\n\n' +

@@ -141,2 +139,3 @@ `Expected ${type} to have been last called with:\n` +

const type = receivedIsSpy ? 'spy' : 'mock function';
const receivedName = receivedIsSpy ? 'spy' : received.getMockName();
const count = receivedIsSpy ?

@@ -148,7 +147,3 @@ received.calls.count() :

() =>
(0, _jestMatcherUtils.matcherHint)(
'.not' + matcherName,
RECEIVED_NAME[type],
String(expected)) +
(0, _jestMatcherUtils.matcherHint)('.not' + matcherName, receivedName, String(expected)) +
`\n\n` +

@@ -159,3 +154,3 @@ `Expected ${type} not to be called ` +

() =>
(0, _jestMatcherUtils.matcherHint)(matcherName, RECEIVED_NAME[type], String(expected)) +
(0, _jestMatcherUtils.matcherHint)(matcherName, receivedName, String(expected)) +
'\n\n' +

@@ -162,0 +157,0 @@ `Expected ${type} to have been called ` +

{
"name": "expect",
"version": "21.3.0-beta.1",
"version": "21.3.0-beta.2",
"repository": {

@@ -13,5 +13,5 @@ "type": "git",

"ansi-styles": "^3.2.0",
"jest-diff": "21.3.0-beta.1",
"jest-get-type": "^21.2.0",
"jest-matcher-utils": "21.3.0-beta.1",
"jest-diff": "21.3.0-beta.2",
"jest-get-type": "21.3.0-beta.2",
"jest-matcher-utils": "21.3.0-beta.2",
"jest-message-util": "^21.2.1",

@@ -18,0 +18,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