Socket
Socket
Sign inDemoInstall

jest-extended

Package Overview
Dependencies
309
Maintainers
2
Versions
40
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.1.0 to 3.2.0

dist/matchers/toBeInRange.js

4

dist/all/index.js
"use strict";
var matchers = _interopRequireWildcard(require("../matchers"));
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
const jestExpect = global.expect;
if (jestExpect !== undefined) {

@@ -12,0 +8,0 @@ jestExpect.extend(matchers);

@@ -6,5 +6,3 @@ "use strict";

});
var _matchers = require("./matchers");
Object.keys(_matchers).forEach(function (key) {

@@ -11,0 +9,0 @@ if (key === "default" || key === "__esModule") return;

@@ -7,3 +7,2 @@ "use strict";

exports.fail = fail;
function fail(_, message) {

@@ -10,0 +9,0 @@ return {

@@ -132,2 +132,8 @@ "use strict";

});
Object.defineProperty(exports, "toBeInRange", {
enumerable: true,
get: function () {
return _toBeInRange.toBeInRange;
}
});
Object.defineProperty(exports, "toBeInteger", {

@@ -427,141 +433,72 @@ enumerable: true,

});
var _fail = require("./fail");
var _pass = require("./pass");
var _toBeAfter = require("./toBeAfter");
var _toBeAfterOrEqualTo = require("./toBeAfterOrEqualTo");
var _toBeArray = require("./toBeArray");
var _toBeArrayOfSize = require("./toBeArrayOfSize");
var _toBeBefore = require("./toBeBefore");
var _toBeBeforeOrEqualTo = require("./toBeBeforeOrEqualTo");
var _toBeBetween = require("./toBeBetween");
var _toBeBoolean = require("./toBeBoolean");
var _toBeDate = require("./toBeDate");
var _toBeDateString = require("./toBeDateString");
var _toBeEmpty = require("./toBeEmpty");
var _toBeEmptyObject = require("./toBeEmptyObject");
var _toBeEven = require("./toBeEven");
var _toBeExtensible = require("./toBeExtensible");
var _toBeFalse = require("./toBeFalse");
var _toBeFinite = require("./toBeFinite");
var _toBeFrozen = require("./toBeFrozen");
var _toBeFunction = require("./toBeFunction");
var _toBeHexadecimal = require("./toBeHexadecimal");
var _toBeInteger = require("./toBeInteger");
var _toBeNaN = require("./toBeNaN");
var _toBeNegative = require("./toBeNegative");
var _toBeNil = require("./toBeNil");
var _toBeNumber = require("./toBeNumber");
var _toBeObject = require("./toBeObject");
var _toBeOdd = require("./toBeOdd");
var _toBeOneOf = require("./toBeOneOf");
var _toBePositive = require("./toBePositive");
var _toBeSealed = require("./toBeSealed");
var _toBeString = require("./toBeString");
var _toBeSymbol = require("./toBeSymbol");
var _toBeTrue = require("./toBeTrue");
var _toBeValidDate = require("./toBeValidDate");
var _toBeWithin = require("./toBeWithin");
var _toContainAllEntries = require("./toContainAllEntries");
var _toContainAllKeys = require("./toContainAllKeys");
var _toContainAllValues = require("./toContainAllValues");
var _toContainAnyEntries = require("./toContainAnyEntries");
var _toContainAnyKeys = require("./toContainAnyKeys");
var _toContainAnyValues = require("./toContainAnyValues");
var _toContainEntries = require("./toContainEntries");
var _toContainEntry = require("./toContainEntry");
var _toContainKey = require("./toContainKey");
var _toContainKeys = require("./toContainKeys");
var _toContainValue = require("./toContainValue");
var _toContainValues = require("./toContainValues");
var _toEndWith = require("./toEndWith");
var _toEqualCaseInsensitive = require("./toEqualCaseInsensitive");
var _toHaveBeenCalledAfter = require("./toHaveBeenCalledAfter");
var _toHaveBeenCalledBefore = require("./toHaveBeenCalledBefore");
var _toHaveBeenCalledOnce = require("./toHaveBeenCalledOnce");
var _toHaveBeenCalledOnceWith = require("./toHaveBeenCalledOnceWith");
var _toInclude = require("./toInclude");
var _toIncludeAllMembers = require("./toIncludeAllMembers");
var _toIncludeAllPartialMembers = require("./toIncludeAllPartialMembers");
var _toIncludeAnyMembers = require("./toIncludeAnyMembers");
var _toIncludeMultiple = require("./toIncludeMultiple");
var _toIncludeRepeated = require("./toIncludeRepeated");
var _toIncludeSameMembers = require("./toIncludeSameMembers");
var _toReject = require("./toReject");
var _toResolve = require("./toResolve");
var _toSatisfy = require("./toSatisfy");
var _toSatisfyAll = require("./toSatisfyAll");
var _toSatisfyAny = require("./toSatisfyAny");
var _toStartWith = require("./toStartWith");
var _toThrowWithMessage = require("./toThrowWithMessage");
var _toEqualIgnoringWhitespace = require("./toEqualIgnoringWhitespace");
var _toPartiallyContain = require("./toPartiallyContain");
var _toPartiallyContain = require("./toPartiallyContain");
var _toBeInRange = require("./toBeInRange");

@@ -7,3 +7,2 @@ "use strict";

exports.pass = pass;
function pass(_, message) {

@@ -10,0 +9,0 @@ return {

@@ -7,3 +7,2 @@ "use strict";

exports.toBeAfter = toBeAfter;
function toBeAfter(date, after) {

@@ -10,0 +9,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toBeAfterOrEqualTo = toBeAfterOrEqualTo;
function toBeAfterOrEqualTo(actual, expected) {

@@ -10,0 +9,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toBeArray = toBeArray;
function toBeArray(expected) {

@@ -10,0 +9,0 @@ const {

@@ -7,5 +7,3 @@ "use strict";

exports.toBeArrayOfSize = toBeArrayOfSize;
var _utils = require("../utils");
function toBeArrayOfSize(actual, expected) {

@@ -12,0 +10,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toBeBefore = toBeBefore;
function toBeBefore(actual, expected) {

@@ -10,0 +9,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toBeBeforeOrEqualTo = toBeBeforeOrEqualTo;
function toBeBeforeOrEqualTo(actual, expected) {

@@ -10,0 +9,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toBeBetween = toBeBetween;
function toBeBetween(actual, startDate, endDate) {

@@ -10,0 +9,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toBeBoolean = toBeBoolean;
function toBeBoolean(actual) {

@@ -10,0 +9,0 @@ const {

@@ -7,5 +7,3 @@ "use strict";

exports.toBeDate = toBeDate;
var _jestGetType = require("jest-get-type");
function toBeDate(actual) {

@@ -12,0 +10,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toBeDateString = toBeDateString;
function toBeDateString(actual) {

@@ -10,0 +9,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toBeEmpty = toBeEmpty;
function toBeEmpty(actual) {

@@ -22,3 +21,2 @@ const {

}
const isEmptyIterable = value => {

@@ -28,5 +26,4 @@ if (typeof value[Symbol.iterator] !== 'function') {

}
const firstIteration = value[Symbol.iterator]().next();
return firstIteration.done;
};

@@ -7,5 +7,3 @@ "use strict";

exports.toBeEmptyObject = toBeEmptyObject;
var _jestGetType = require("jest-get-type");
function toBeEmptyObject(actual) {

@@ -12,0 +10,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toBeEven = toBeEven;
function toBeEven(actual) {

@@ -22,5 +21,3 @@ const {

}
const isNumber = expected => !isNaN(parseInt(expected));
const isEven = expected => expected % 2 === 0;

@@ -7,3 +7,2 @@ "use strict";

exports.toBeExtensible = toBeExtensible;
function toBeExtensible(actual) {

@@ -10,0 +9,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toBeFalse = toBeFalse;
function toBeFalse(actual) {

@@ -10,0 +9,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toBeFinite = toBeFinite;
function toBeFinite(actual) {

@@ -10,0 +9,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toBeFrozen = toBeFrozen;
function toBeFrozen(actual) {

@@ -10,0 +9,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toBeFunction = toBeFunction;
function toBeFunction(actual) {

@@ -10,0 +9,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toBeHexadecimal = toBeHexadecimal;
function toBeHexadecimal(actual) {

@@ -22,4 +21,3 @@ const {

}
const longRegex = RegExp(/^#\b[a-f0-9]{6}\b/gi);
const shortRegex = RegExp(/^#\b[a-f0-9]{3}\b/gi);

@@ -7,3 +7,2 @@ "use strict";

exports.toBeInteger = toBeInteger;
function toBeInteger(actual) {

@@ -22,5 +21,3 @@ const {

}
const isNumber = value => !isNaN(parseInt(value));
const isInteger = value => Number.isInteger(+value);

@@ -7,3 +7,2 @@ "use strict";

exports.toBeNaN = toBeNaN;
function toBeNaN(actual) {

@@ -10,0 +9,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toBeNegative = toBeNegative;
function toBeNegative(actual) {

@@ -22,5 +21,3 @@ const {

}
const isNumber = value => !isNaN(parseInt(value));
const isNegative = value => value < 0;

@@ -7,3 +7,2 @@ "use strict";

exports.toBeNil = toBeNil;
function toBeNil(actual) {

@@ -10,0 +9,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toBeNumber = toBeNumber;
function toBeNumber(actual) {

@@ -10,0 +9,0 @@ const {

@@ -7,5 +7,3 @@ "use strict";

exports.toBeObject = toBeObject;
var _jestGetType = require("jest-get-type");
function toBeObject(actual) {

@@ -12,0 +10,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toBeOdd = toBeOdd;
function toBeOdd(received) {

@@ -10,0 +9,0 @@ const {

@@ -7,5 +7,3 @@ "use strict";

exports.toBeOneOf = toBeOneOf;
var _utils = require("../utils");
function toBeOneOf(actual, expected) {

@@ -17,4 +15,4 @@ const {

} = this.utils;
const passMessage = matcherHint('.not.toBeOneOf', 'item', 'list') + '\n\n' + 'Expected value to not be in list:\n' + ` ${printExpected(expected)}\n` + 'Received:\n' + ` ${printReceived(actual)}`;
const failMessage = matcherHint('.toBeOneOf', 'item', 'list') + '\n\n' + 'Expected value to be in list:\n' + ` ${printExpected(expected)}\n` + 'Received:\n' + ` ${printReceived(actual)}`;
const passMessage = matcherHint('.not.toBeOneOf') + '\n\n' + 'Expected value to not be in list:\n' + ` ${printExpected(expected)}\n` + 'Received:\n' + ` ${printReceived(actual)}`;
const failMessage = matcherHint('.toBeOneOf') + '\n\n' + 'Expected value to be in list:\n' + ` ${printExpected(expected)}\n` + 'Received:\n' + ` ${printReceived(actual)}`;
const pass = (0, _utils.contains)(this.equals, expected, actual);

@@ -21,0 +19,0 @@ return {

@@ -7,3 +7,2 @@ "use strict";

exports.toBePositive = toBePositive;
function toBePositive(actual) {

@@ -10,0 +9,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toBeSealed = toBeSealed;
function toBeSealed(actual) {

@@ -10,0 +9,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toBeString = toBeString;
function toBeString(expected) {

@@ -10,0 +9,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toBeSymbol = toBeSymbol;
function toBeSymbol(actual) {

@@ -10,0 +9,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toBeTrue = toBeTrue;
function toBeTrue(actual) {

@@ -10,0 +9,0 @@ const {

@@ -7,5 +7,3 @@ "use strict";

exports.toBeValidDate = toBeValidDate;
var _jestGetType = require("jest-get-type");
function toBeValidDate(actual) {

@@ -12,0 +10,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toBeWithin = toBeWithin;
function toBeWithin(actual, start, end) {

@@ -10,0 +9,0 @@ const {

@@ -7,5 +7,3 @@ "use strict";

exports.toContainAllEntries = toContainAllEntries;
var _utils = require("../utils");
function toContainAllEntries(actual, expected) {

@@ -12,0 +10,0 @@ const {

@@ -7,5 +7,3 @@ "use strict";

exports.toContainAllKeys = toContainAllKeys;
var _utils = require("../utils");
function toContainAllKeys(actual, expected) {

@@ -12,0 +10,0 @@ const {

@@ -7,5 +7,3 @@ "use strict";

exports.toContainAllValues = toContainAllValues;
var _utils = require("../utils");
function toContainAllValues(actual, expected) {

@@ -12,0 +10,0 @@ const {

@@ -7,5 +7,3 @@ "use strict";

exports.toContainAnyEntries = toContainAnyEntries;
var _utils = require("../utils");
function toContainAnyEntries(actual, expected) {

@@ -12,0 +10,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toContainAnyKeys = toContainAnyKeys;
function toContainAnyKeys(actual, expected) {

@@ -10,0 +9,0 @@ const {

@@ -7,5 +7,3 @@ "use strict";

exports.toContainAnyValues = toContainAnyValues;
var _utils = require("../utils");
function toContainAnyValues(actual, expected) {

@@ -12,0 +10,0 @@ const {

@@ -7,5 +7,3 @@ "use strict";

exports.toContainEntries = toContainEntries;
var _utils = require("../utils");
function toContainEntries(actual, expected) {

@@ -12,0 +10,0 @@ const {

@@ -7,5 +7,3 @@ "use strict";

exports.toContainEntry = toContainEntry;
var _utils = require("../utils");
function toContainEntry(actual, expected) {

@@ -12,0 +10,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toContainKey = toContainKey;
function toContainKey(actual, expected) {

@@ -10,0 +9,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toContainKeys = toContainKeys;
function toContainKeys(actual, expected) {

@@ -10,0 +9,0 @@ const {

@@ -7,5 +7,3 @@ "use strict";

exports.toContainValue = toContainValue;
var _utils = require("../utils");
function toContainValue(actual, expected) {

@@ -12,0 +10,0 @@ const {

@@ -7,5 +7,3 @@ "use strict";

exports.toContainValues = toContainValues;
var _utils = require("../utils");
function toContainValues(actual, expected) {

@@ -12,0 +10,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toEndWith = toEndWith;
function toEndWith(actual, expected) {

@@ -10,0 +9,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toEqualCaseInsensitive = toEqualCaseInsensitive;
function toEqualCaseInsensitive(actual, expected) {

@@ -10,0 +9,0 @@ const {

@@ -7,14 +7,10 @@ "use strict";

exports.toEqualIgnoringWhitespace = toEqualIgnoringWhitespace;
var _jestDiff = require("jest-diff");
var _print = require("../utils/print");
const removeWhitespace = str => str.trim().replace(/\s+/g, '');
const predicate = (received, expected) => {
/* calculate diff of received w.r.t expected string */
const diff = (0, _jestDiff.diffStringsRaw)(expected, received);
/* mark every diff result object with value of white-space as DIFF_EQUAL */
diff.forEach(diffObject => {

@@ -24,4 +20,4 @@ if (diffObject[1].trim()) return;

});
/* determine whether strings are equal after removing white-space */
const pass = removeWhitespace(received) === removeWhitespace(expected);

@@ -33,3 +29,2 @@ return {

};
function toEqualIgnoringWhitespace(actual, expected) {

@@ -36,0 +31,0 @@ const {

@@ -7,5 +7,3 @@ "use strict";

exports.toHaveBeenCalledAfter = toHaveBeenCalledAfter;
var _utils = require("../utils");
function toHaveBeenCalledAfter(actual, expected, failIfNoFirstInvocation = true) {

@@ -17,3 +15,2 @@ const {

} = this.utils;
if (!(0, _utils.isJestMockOrSpy)(actual)) {

@@ -25,3 +22,2 @@ return {

}
if (!(0, _utils.isJestMockOrSpy)(expected)) {

@@ -33,3 +29,2 @@ return {

}
const firstInvocationCallOrder = actual.mock.invocationCallOrder;

@@ -45,5 +40,3 @@ const secondInvocationCallOrder = expected.mock.invocationCallOrder;

}
const smallest = ns => ns.reduce((acc, n) => acc < n ? acc : n);
const predicate = (firstInvocationCallOrder, secondInvocationCallOrder, failIfNoFirstInvocation) => {

@@ -56,3 +49,2 @@ if (firstInvocationCallOrder.length === 0) return !failIfNoFirstInvocation;

};
const mockCheckFailMessage = (utils, value, isReceivedValue) => () => {

@@ -59,0 +51,0 @@ const valueKind = isReceivedValue ? 'Received' : 'Expected';

@@ -7,5 +7,3 @@ "use strict";

exports.toHaveBeenCalledBefore = toHaveBeenCalledBefore;
var _utils = require("../utils");
function toHaveBeenCalledBefore(actual, expected, failIfNoSecondInvocation = true) {

@@ -17,3 +15,2 @@ const {

} = this.utils;
if (!(0, _utils.isJestMockOrSpy)(actual)) {

@@ -25,3 +22,2 @@ return {

}
if (!(0, _utils.isJestMockOrSpy)(expected)) {

@@ -33,3 +29,2 @@ return {

}
const firstInvocationCallOrder = actual.mock.invocationCallOrder;

@@ -45,3 +40,2 @@ const secondInvocationCallOrder = expected.mock.invocationCallOrder;

}
const mockCheckFailMessage = (utils, value, isReceivedValue) => () => {

@@ -52,5 +46,3 @@ const valueKind = isReceivedValue ? 'Received' : 'Expected';

};
const smallest = ns => ns.reduce((acc, n) => acc < n ? acc : n);
const predicate = (firstInvocationCallOrder, secondInvocationCallOrder, failIfNoSecondInvocation) => {

@@ -57,0 +49,0 @@ if (firstInvocationCallOrder.length === 0) return false;

@@ -7,5 +7,3 @@ "use strict";

exports.toHaveBeenCalledOnce = toHaveBeenCalledOnce;
var _utils = require("../utils");
function toHaveBeenCalledOnce(received) {

@@ -17,3 +15,2 @@ const {

} = this.utils;
if (!(0, _utils.isJestMockOrSpy)(received)) {

@@ -25,3 +22,2 @@ return {

}
const passMessage = matcherHint('.not.toHaveBeenCalledOnce') + '\n\n' + 'Expected mock function to have been called any amount of times but one, but it was called exactly once.';

@@ -28,0 +24,0 @@ const failMessage = matcherHint('.toHaveBeenCalledOnce') + '\n\n' + 'Expected mock function to have been called exactly once, but it was called:\n' + ` ${printReceived(received.mock.calls.length)} times`;

@@ -7,8 +7,5 @@ "use strict";

exports.toHaveBeenCalledOnceWith = toHaveBeenCalledOnceWith;
var _utils = require("../utils");
function toHaveBeenCalledOnceWith(received, expected) {
var _received$mock$calls$;
const {

@@ -20,3 +17,2 @@ printReceived,

} = this.utils;
if (!(0, _utils.isJestMockOrSpy)(received)) {

@@ -28,3 +24,2 @@ return {

}
const passMessage = matcherHint('.not.toHaveBeenCalledOnceWith') + '\n\n' + `Expected mock function to have been called any amount of times but one with ${printExpected(expected)}, but it was called exactly once with ${printExpected(expected)}.`;

@@ -31,0 +26,0 @@ const failOnceMessage = matcherHint('.toHaveBeenCalledOnceWith') + '\n\n' + 'Expected mock function to have been called exactly once, but it was called:\n' + ` ${printReceived(received.mock.calls.length)} times`;

@@ -7,3 +7,2 @@ "use strict";

exports.toInclude = toInclude;
function toInclude(actual, expected) {

@@ -10,0 +9,0 @@ const {

@@ -7,5 +7,3 @@ "use strict";

exports.toIncludeAllMembers = toIncludeAllMembers;
var _utils = require("../utils");
function toIncludeAllMembers(actual, expected) {

@@ -12,0 +10,0 @@ const {

@@ -7,5 +7,3 @@ "use strict";

exports.toIncludeAllPartialMembers = toIncludeAllPartialMembers;
var _utils = require("../utils");
function toIncludeAllPartialMembers(actual, expected) {

@@ -12,0 +10,0 @@ const {

@@ -7,5 +7,3 @@ "use strict";

exports.toIncludeAnyMembers = toIncludeAnyMembers;
var _utils = require("../utils");
function toIncludeAnyMembers(actual, expected) {

@@ -12,0 +10,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toIncludeMultiple = toIncludeMultiple;
function toIncludeMultiple(actual, expected) {

@@ -10,0 +9,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toIncludeRepeated = toIncludeRepeated;
function toIncludeRepeated(actual, expected, occurrences) {

@@ -10,0 +9,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toIncludeSameMembers = toIncludeSameMembers;
function toIncludeSameMembers(actual, expected) {

@@ -23,3 +22,2 @@ const {

}
const predicate = (equals, actual, expected) => {

@@ -29,11 +27,8 @@ if (!Array.isArray(actual) || !Array.isArray(expected) || actual.length !== expected.length) {

}
const remaining = expected.reduce((remaining, secondValue) => {
if (remaining === null) return remaining;
const index = remaining.findIndex(firstValue => equals(secondValue, firstValue));
if (index === -1) {
return null;
}
return remaining.slice(0, index).concat(remaining.slice(index + 1));

@@ -40,0 +35,0 @@ }, actual);

@@ -7,5 +7,3 @@ "use strict";

exports.toPartiallyContain = toPartiallyContain;
var _utils = require("../utils");
function toPartiallyContain(actual, expected) {

@@ -12,0 +10,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toReject = toReject;
async function toReject(actual) {

@@ -10,0 +9,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toResolve = toResolve;
async function toResolve(actual) {

@@ -10,0 +9,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toSatisfy = toSatisfy;
function toSatisfy(actual, expected) {

@@ -10,0 +9,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toSatisfyAll = toSatisfyAll;
function toSatisfyAll(actual, expected) {

@@ -10,0 +9,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toSatisfyAny = toSatisfyAny;
function toSatisfyAny(actual, expected) {

@@ -10,0 +9,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toStartWith = toStartWith;
function toStartWith(actual, expected) {

@@ -10,0 +9,0 @@ const {

@@ -7,3 +7,2 @@ "use strict";

exports.toThrowWithMessage = toThrowWithMessage;
const predicate = (error, type, message) => {

@@ -13,22 +12,15 @@ if (message instanceof RegExp) {

}
return error && error instanceof type && error.message === message;
};
const positiveHint = utils => utils.matcherHint('.toThrowWithMessage', 'function', 'type', {
secondArgument: 'message'
});
const negativeHint = utils => utils.matcherHint('.not.toThrowWithMessage', 'function', 'type', {
secondArgument: 'message'
});
const passMessage = (utils, received, expected) => () => negativeHint(utils) + '\n\n' + 'Expected not to throw:\n' + ` ${utils.printExpected(expected)}\n` + 'Thrown:\n' + ` ${utils.printReceived(received)}\n`;
const failMessage = (utils, received, expected) => () => positiveHint(utils) + '\n\n' + 'Expected to throw:\n' + ` ${utils.printExpected(expected)}\n` + 'Thrown:\n' + ` ${utils.printReceived(received)}\n`;
function toThrowWithMessage(callbackOrPromiseReturn, type, message) {
const utils = this.utils;
const isFromReject = this && this.promise === 'rejects'; // See https://github.com/facebook/jest/pull/7621#issue-244312550
if ((!callbackOrPromiseReturn || typeof callbackOrPromiseReturn !== 'function') && !isFromReject) {

@@ -40,3 +32,2 @@ return {

}
if (!type || typeof type !== 'function') {

@@ -48,3 +39,2 @@ return {

}
if (!message) {

@@ -56,3 +46,2 @@ return {

}
if (typeof message !== 'string' && !(message instanceof RegExp)) {

@@ -64,5 +53,3 @@ return {

}
let error;
if (isFromReject) {

@@ -77,3 +64,2 @@ error = callbackOrPromiseReturn;

}
if (!error) {

@@ -85,7 +71,5 @@ return {

}
const pass = predicate(error, type, message);
const messageStr = message.toString();
let expectedError;
try {

@@ -99,3 +83,2 @@ expectedError = new type(messageStr);

}
if (pass) {

@@ -107,3 +90,2 @@ return {

}
return {

@@ -110,0 +92,0 @@ pass: false,

@@ -7,23 +7,15 @@ "use strict";

exports.isJestMockOrSpy = exports.determinePropertyMessage = exports.containsEntry = exports.contains = void 0;
const contains = (equals, list, value) => {
return list.findIndex(item => equals(item, value)) > -1;
};
exports.contains = contains;
const determinePropertyMessage = (actual, property, message = 'Not Accessible') => {
return actual && Object.hasOwnProperty.call(actual, property) ? actual[property] : message;
};
exports.determinePropertyMessage = determinePropertyMessage;
const isJestMockOrSpy = value => {
return !!(value && value._isMockFunction === true && typeof value.mock === 'object');
};
exports.isJestMockOrSpy = isJestMockOrSpy;
const containsEntry = (equals, obj, [key, value]) => obj.hasOwnProperty && Object.prototype.hasOwnProperty.call(obj, key) && equals(obj[key], value);
exports.containsEntry = containsEntry;

@@ -7,16 +7,11 @@ "use strict";

exports.tokenize = exports.printReceived = exports.printExpected = void 0;
var _jestDiff = require("jest-diff");
const tokenize = str => {
const isWhitespace = char => /\s/.test(char);
const tokens = [];
let idx = 0;
let token;
while (idx < str.length) {
const char = str.charAt(idx);
const isCurrentCharWhitespace = isWhitespace(char);
if (token) {

@@ -36,14 +31,10 @@ if (token.isWhitespace === isCurrentCharWhitespace) {

}
idx += 1;
}
/* push last token */
tokens.push(token);
return tokens;
};
exports.tokenize = tokenize;
const colorTokens = (str, color) => {

@@ -56,3 +47,2 @@ const tokens = tokenize(str);

};
const printExpected = (utils, diff) => diff.reduce((acc, diffObject) => {

@@ -65,5 +55,3 @@ const operation = diffObject[0];

}, '');
exports.printExpected = printExpected;
const printReceived = (utils, diff) => diff.reduce((acc, diffObject) => {

@@ -76,3 +64,2 @@ const operation = diffObject[0];

}, '');
exports.printReceived = printReceived;
{
"name": "jest-extended",
"version": "3.1.0",
"version": "3.2.0",
"description": "Additional Jest matchers",

@@ -22,3 +22,4 @@ "main": "dist/index.js",

"test:watch": "yarn test --watch",
"typecheck": "tsc --noEmit types/index.d.ts"
"typecheck": "tsc --noEmit types/index.d.ts",
"dev:docs": "cd website && yarn start"
},

@@ -130,3 +131,8 @@ "keywords": [

"jest": ">=27.2.5"
},
"peerDependenciesMeta": {
"jest": {
"optional": true
}
}
}

@@ -33,1124 +33,16 @@ <div align="center">

---
- [Problem](#problem)
- [Solution](#solution)
- [Contributing](#contributing)
- [Installation](#installation)
- [Setup](#setup)
- [Typescript](#typescript)
- [Asymmetric matchers](#asymmetric-matchers)
- [API](#api)
- [.pass(message)](#passmessage)
- [.fail(message)](#failmessage)
- [.toBeEmpty()](#tobeempty)
- [.toBeOneOf([members])](#tobeoneofmembers)
- [.toBeNil()](#tobenil)
- [.toSatisfy(predicate)](#tosatisfypredicate)
- [Array](#array)
- [.toBeArray()](#tobearray)
- [.toBeArrayOfSize()](#tobearrayofsize)
- [.toIncludeAllMembers([members])](#toincludeallmembersmembers)
- [.toIncludeAllPartialMembers([members])](#toincludeallpartialmembersmembers)
- [.toIncludeAnyMembers([members])](#toincludeanymembersmembers)
- [.toIncludeSameMembers([members])](#toincludesamemembersmembers)
- [.toPartiallyContain(member)](#topartiallycontainmember)
- [.toSatisfyAll(predicate)](#tosatisfyallpredicate)
- [.toSatisfyAny(predicate)](#tosatisfyanypredicate)
- [Boolean](#boolean)
- [.toBeBoolean()](#tobeboolean)
- [.toBeTrue()](#tobetrue)
- [.toBeFalse()](#tobefalse)
- [Date](#date)
- [.toBeDate()](#tobedate)
- [.toBeValidDate()](#tobevaliddate)
- [.toBeAfter(date)](#tobeafterdate)
- [.toBeBefore(date)](#tobebeforedate)
- [.toBeAfterOrEqualTo(date)](#tobeafterorequaltodate)
- [.toBeBeforeOrEqualTo(date)](#tobebeforeorequaltodate)
- [.toBeBetween(startDate, endDate)](#tobebetweenstartdate-enddate)
- Further proposals in [#117](https://github.com/jest-community/jest-extended/issues/117) PRs welcome
- [Function](#function)
- [.toBeFunction()](#tobefunction)
- [.toThrowWithMessage()](#tothrowwithmessagetype-message)
- [Mock](#mock)
- [.toHaveBeenCalledBefore()](#tohavebeencalledbefore)
- [.toHaveBeenCalledAfter()](#tohavebeencalledafter)
- [.toHaveBeenCalledOnce()](#tohavebeencalledonce)
- [.toHaveBeenCalledOnceWith()](#tohavebeencalledoncewith)
- [Number](#number)
- [.toBeNumber()](#tobenumber)
- [.toBeNaN()](#tobenan)
- [.toBeFinite()](#tobefinite)
- [.toBePositive()](#tobepositive)
- [.toBeNegative()](#tobenegative)
- [.toBeEven()](#tobeeven)
- [.toBeOdd()](#tobeodd)
- [.toBeWithin(start, end)](#tobewithinstart-end)
- [.toBeInteger()](#tobeinteger)
- [Object](#object)
- [.toBeObject()](#tobeobject)
- [.toBeEmptyObject()](#tobeemptyobject)
- [.toContainKey(key)](#tocontainkeykey)
- [.toContainKeys([keys])](#tocontainkeyskeys)
- [.toContainAllKeys([keys])](#tocontainallkeyskeys)
- [.toContainAnyKeys([keys])](#tocontainanykeyskeys)
- [.toContainValue(value)](#tocontainvaluevalue)
- [.toContainValues([values])](#tocontainvaluesvalues)
- [.toContainAllValues([values])](#tocontainallvaluesvalues)
- [.toContainAnyValues([values])](#tocontainanyvaluesvalues)
- [.toContainEntry([key, value])](#tocontainentrykey-value)
- [.toContainEntries([[key, value]])](#tocontainentrieskey-value)
- [.toContainAllEntries([[key, value]])](#tocontainallentrieskey-value)
- [.toContainAnyEntries([[key, value]])](#tocontainanyentrieskey-value)
- [.toBeExtensible()](#tobeextensible)
- [.toBeFrozen()](#tobefrozen)
- [.toBeSealed()](#tobesealed)
- [Promise](#promise)
- [.toResolve()](#toresolve)
- [.toReject()](#toreject)
- [String](#string)
- [.toBeString()](#tobestring)
- [.toBeHexadecimal(string)](#tobehexadecimal)
- [.toBeDateString(string)](#tobedatestringstring)
- [.toEqualCaseInsensitive(string)](#toequalcaseinsensitivestring)
- [.toStartWith(prefix)](#tostartwithprefix)
- [.toEndWith(suffix)](#toendwithsuffix)
- [.toInclude(substring)](#toincludesubstring)
- [.toIncludeRepeated(substring, times)](#toincluderepeatedsubstring-times)
- [.toIncludeMultiple([substring])](#toincludemultiplesubstring)
- [.toEqualIgnoringWhitespace(string)](#toequalignoringwhitespacestring)
- [Symbol](#symbol)
- [.toBeSymbol()](#tobesymbol)
- [LICENSE](#license)
## Installation
With npm:
See the [Installation Guide](https://jest-extended.jestcommunity.dev/docs/getting-started/install) on Jest Extended documentation site.
```sh
npm install --save-dev jest-extended
```
With yarn:
```sh
yarn add -D jest-extended
```
If you're using ESLint you might also want to checkout [`eslint-plugin-jest-extended`](https://github.com/jest-community/eslint-plugin-jest-extended).
## Setup
Note that `jest-extended` only supports Jest version `27.2.5` and newer. If you're using an older version of Jest, use `1.2.1`.
See the [Setup instructions](https://jest-extended.jestcommunity.dev/docs/getting-started/setup) on Jest Extended documentation site.
```javascript
// ./testSetup.js
## Matchers
// add all jest-extended matchers
import * as matchers from 'jest-extended';
expect.extend(matchers);
See all available [matchers and interactive repl](https://jest-extended.jestcommunity.dev/docs/matchers) on Jest Extended documentation site.
// or just add specific matchers
import { toBeArray, toBeSealed } from 'jest-extended';
expect.extend({ toBeArray, toBeSealed });
```
Add your setup script to your Jest `setupFilesAfterEnv` configuration. [See for help](https://jestjs.io/docs/en/configuration.html#setupfilesafterenv-array)
```json
"jest": {
"setupFilesAfterEnv": ["./testSetup.js"]
}
```
To automatically extend `expect` with all matchers, you can use
```json
"jest": {
"setupFilesAfterEnv": ["jest-extended/all"]
}
```
### Typescript
If your editor does not recognise the custom `jest-extended` matchers, add a `global.d.ts` file to your project with:
```ts
import 'jest-extended';
```
_Note: When using `ts-jest >= 25.5.0`_
Since the breaking changes in `25.5.0` you may also need to update your `tsconfig.json` to include the new `global.d.ts` file in the `files` property like so:
```json
{
"compilerOptions": {
...
},
...
"files": ["global.d.ts"]
}
```
Also note that when adding this for the first time this affects which files are compiled by the TypeScript compiler and you might need to add the `include` property as well. See the [TypeScript docs](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) for more details.
If the above import syntax does not work, replace it with the following:
```ts
/// <reference types="jest-extended" />
```
## Asymmetric matchers
All matchers described in the API are also asymmetrical since [jest version 23](https://jestjs.io/blog/2018/05/29/jest-23-blazing-fast-delightful-testing#custom-asymmetric-matchers):
```js
test('passes when using an asymmetrical matcher', () => {
expect([]).toEqual(expect.toBeArray());
});
```
## API
#### .pass(message)
Passing assertion.
```js
expect().pass('should pass');
```
#### .fail(message)
Failing assertion.
```js
expect().fail('test should fail');
```
#### .toBeEmpty()
Use `.toBeEmpty` when checking if a `String` `''`, `Array` `[]`, `Object` `{}`, or [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#Built-in_iterables) is empty. Because `toBeEmpty` supports checking for emptiness of Iterables, you can use it to check whether a `Map`, or `Set` is empty, as well as checking that a generator yields no values.
```js
test('passes when given an empty string', () => {
expect('').toBeEmpty();
expect('hello').not.toBeEmpty();
});
test('passes when given an empty array', () => {
expect([]).toBeEmpty();
expect(['hello']).not.toBeEmpty();
});
test('passes when given an empty object', () => {
expect({}).toBeEmpty();
expect({ hello: 'world' }).not.toBeEmpty();
});
```
#### .toBeOneOf([members])
Use `.toBeOneOf` when checking if a value is a member of a given `Array`.
```js
test('passes when value is in given array', () => {
expect(1).toBeOneOf([1, 2, 3]);
expect(4).not.toBeOneOf([1, 2, 3]);
});
```
#### .toBeNil()
Use `.toBeNil` when checking a value is `null` or `undefined`.
```js
test('passes when value is null or undefined', () => {
expect(null).toBeNil();
expect(undefined).toBeNil();
expect(true).not.toBeNil();
});
```
#### .toSatisfy(predicate)
Use `.toSatisfy` when you want to use a custom matcher by supplying a predicate function that returns a `Boolean`.
```js
test('passes when value passes given predicate', () => {
const greaterThanOneButNotThree = n => n > 1 && n !== 3;
expect(100).toSatisfy(greaterThanOneButNotThree);
expect(0).not.toSatisfy(greaterThanOneButNotThree);
expect(3).not.toSatisfy(greaterThanOneButNotThree);
});
```
### Array
#### .toBeArray()
Use `.toBeArray` when checking if a value is an `Array`.
```js
test('passes when value is an array', () => {
expect([]).toBeArray();
expect([1]).toBeArray();
expect(true).not.toBeArray();
});
```
#### .toBeArrayOfSize()
Use `.toBeArrayOfSize` when checking if a value is an `Array` of size x.
```js
test('passes when value is an array', () => {
expect([]).toBeArrayOfSize(0);
expect([1]).toBeArrayOfSize(1);
expect(true).not.toBeArrayOfSize(1);
});
```
#### .toIncludeAllMembers([members])
Use `.toIncludeAllMembers` when checking if an `Array` contains all of the same members of a given set.
```js
test('passes when given array values match the members of the set', () => {
expect([1, 2, 3]).toIncludeAllMembers([2, 1, 3]);
expect([1, 2, 2]).toIncludeAllMembers([2, 1]);
});
```
#### .toIncludeAllPartialMembers([members])
Use `.toIncludeAllPartialMembers` when checking if an `Array` contains all of the same partial members of a given set.
```js
test('passes when given array values match the partial members of the set', () => {
expect([{ foo: 'bar', baz: 'qux' }]).toIncludeAllPartialMembers([{ foo: 'bar' }]);
});
```
#### .toIncludeAnyMembers([members])
Use `.toIncludeAnyMembers` when checking if an `Array` contains any of the members of a given set.
```js
test('passes when given array values match any of the members in the set', () => {
expect([1, 2, 3]).toIncludeAnyMembers([2, 1, 3]);
expect([1, 2, 2]).toIncludeAnyMembers([2]);
expect([1, 2, 2]).not.toIncludeAnyMembers([3]);
});
```
#### .toIncludeSameMembers([members])
Use `.toIncludeSameMembers` when checking if two arrays contain equal values, in any order.
```js
test('passes when arrays match in a different order', () => {
expect([1, 2, 3]).toIncludeSameMembers([3, 1, 2]);
expect([{ foo: 'bar' }, { baz: 'qux' }]).toIncludeSameMembers([{ baz: 'qux' }, { foo: 'bar' }]);
});
```
#### .toPartiallyContain(member)
Use `.toPartiallyContain` when checking if any array value matches the partial member.
```js
test('passes when a string has a given substring', () => {
expect([{ foo: 'bar', baz: 'qux', bax: 'zax' }]).toPartiallyContain({ foo: 'bar' });
expect([{ foo: 'bar', baz: 'qux', bax: 'zax' }]).toPartiallyContain({ baz: 'qux' });
expect([{ foo: 'bar', baz: 'qux', bax: 'zax' }]).not.toPartiallyContain({ foo: 'qux' });
});
```
#### .toSatisfyAll(predicate)
Use `.toSatisfyAll` when you want to use a custom matcher by supplying a predicate function that returns a `Boolean` for all values in an array.
```js
test('passes when all values in array pass given predicate', () => {
const isOdd = el => el % 2 === 1;
expect([1, 3, 5, 7]).toSatisfyAll(isOdd);
expect([1, 3, 4, 5, 7]).not.toSatisfyAll(isOdd);
});
```
#### .toSatisfyAny(predicate)
Use `.toSatisfyAny` when you want to use a custom matcher by supplying a predicate function that returns `true` for any matching value in an array.
```js
test('passes when any value in array pass given predicate', () => {
const isOdd = el => el % 2 === 1;
expect([2, 3, 6, 8]).toSatisfyAny(isOdd);
expect([2, 4, 8, 12]).not.toSatisfyAny(isOdd);
});
```
### Boolean
#### .toBeBoolean()
Use `.toBeBoolean` when checking if a value is a `Boolean`.
```js
test('passes when value is a boolean', () => {
expect(false).toBeBoolean();
expect(true).toBeBoolean();
expect(1 === 1).toBeBoolean();
expect(1).not.toBeBoolean();
});
```
#### .toBeTrue()
Use `.toBeTrue` when checking a value is equal (===) to `true`.
```js
test('is jest cool', () => {
expect(isJestCool()).toBeTrue();
expect(false).not.toBeTrue();
});
```
#### .toBeFalse()
Use `.toBeFalse` when checking a value is equal (===) to `false`.
```js
test('returns false', () => {
expect(areWeThereYet()).toBeFalse();
expect(true).not.toBeFalse();
});
```
### ~~Date~~
Proposal in #117 (_under development_)
### .toBeDate()
Use `.toBeDate` when checking if a value is a `Date`.
```js
test('passes when value is a date', () => {
expect(new Date()).toBeDate();
expect('01/01/2018').not.toBeDate();
expect(new Date('01/01/2018')).toBeDate();
expect(undefined).not.toBeDate();
});
```
### .toBeValidDate()
Use `.toBeValidDate` when checking if a given `Date` object is valid.
```js
test('passes when Date is valid', () => {
expect(new Date()).toBeValidDate();
expect('01/01/2018').not.toBeValidDate();
expect(new Date('01/01/2018')).toBeValidDate();
expect(new Date('01/90/2018')).not.toBeValidDate();
expect(undefined).not.toBeValidDate();
});
```
### .toBeAfter(date)
Use `.toBeAfter` when checking if a date occurs after `date`.
```js
test('passes when input is after date', () => {
expect(new Date('01/01/2019')).toBeAfter(new Date('01/01/2018'));
expect('01/01/2018').not.toBeAfter(new Date('01/01/2019'));
});
```
### .toBeBefore(date)
Use `.toBeBefore` when checking if a date occurs before `date`.
```js
test('passes when input is before date', () => {
expect(new Date('01/01/2018')).toBeBefore(new Date('01/01/2019'));
expect('01/01/2019').not.toBeBefore(new Date('01/01/2018'));
});
```
### .toBeAfterOrEqualTo(date)
Use `.toBeAfterOrEqualTo` when checking if a date equals to or occurs after `date`.
```js
test('passes when input is equal to or after date', () => {
expect(new Date('01/01/2019')).toBeAfterOrEqualTo(new Date('01/01/2018'));
expect(new Date('01/01/2019')).toBeAfterOrEqualTo(new Date('01/01/2019'));
expect('01/01/2018').not.toBeAfterOrEqualTo(new Date('01/01/2019'));
});
```
### .toBeBeforeOrEqualTo(date)
Use `.toBeBeforeOrEqualTo` when checking if a date equals to or occurs before `date`.
```js
test('passes when input is equal to or before date', () => {
expect(new Date('01/01/2018')).toBeBeforeOrEqualTo(new Date('01/01/2019'));
expect(new Date('01/01/2018')).toBeBeforeOrEqualTo(new Date('01/01/2018'));
expect('01/01/2019').not.toBeBeforeOrEqualTo(new Date('01/01/2018'));
});
```
### .toBeBetween(startDate, endDate)
Use `.toBeBetween` when checking if a date equals or occurs after `startDate` and equals or occurs before `endDate`.
```js
test('passes when input is in given date range', () => {
expect(new Date('05/01/2019')).toBeBetween(new Date('01/01/2019'), new Date('10/01/2019');
expect(new Date('05/01/2019')).toBeBetween(new Date('05/01/2019'), new Date('10/01/2019');
expect(new Date('01/01/2019')).not.toBeBetween(new Date('05/01/2019'), new Date('10/01/2019'));
});
```
### Function
#### .toBeFunction()
Use `.toBeFunction` when checking if a value is a `Function`.
```js
test('passes when value is a function', () => {
function noop() {}
expect(() => {}).toBeFunction();
expect(function () {}).not.toBeFunction();
expect(noop).toBeFunction();
expect(true).not.toBeFunction();
});
```
#### .toThrowWithMessage(type, message)
Use `.toThrowWithMessage` when checking if a callback function throws an error with a given error type and given error message. Message can either be a `String` or a `RegExp`.
```js
test('throws an error of type TypeError with message "hello world"', () => {
expect(() => {
throw TypeError('hello world');
}).toThrowWithMessage(TypeError, 'hello world');
expect(() => {
throw TypeError('hello world');
}).toThrowWithMessage(TypeError, /hello world/);
expect(() => {
throw TypeError('hello world 2');
}).not.toThrowWithMessage(TypeError, 'hello world');
expect(() => {
throw TypeError('hello world 2');
}).not.toThrowWithMessage(TypeError, /hello world/);
});
```
This works for promise rejections too.
```js
test('throws an error of type TypeError with message "hello world"', async () => {
await expect(Promise.reject(new TypeError("hello world async")).rejects.toThrowWithMessage(TypeError, /hello world/);
});
```
### Mock
#### .toHaveBeenCalledBefore()
Use `.toHaveBeenCalledBefore` when checking if a `Mock` was called before another `Mock`.
```js
it('calls mock1 before mock2', () => {
const mock1 = jest.fn();
const mock2 = jest.fn();
mock1();
mock2();
mock1();
expect(mock1).toHaveBeenCalledBefore(mock2);
});
```
#### .toHaveBeenCalledAfter()
Use `.toHaveBeenCalledAfter` when checking if a `Mock` was called after another `Mock`.
```js
it('calls mock1 after mock2', () => {
const mock1 = jest.fn();
const mock2 = jest.fn();
mock2();
mock1();
mock2();
expect(mock1).toHaveBeenCalledAfter(mock2);
});
```
#### .toHaveBeenCalledOnce()
Use `.toHaveBeenCalledOnce` to check if a `Mock` was called exactly one time.
```js
it('passes only if mock was called exactly once', () => {
const mock = jest.fn();
expect(mock).not.toHaveBeenCalled();
mock();
expect(mock).toHaveBeenCalledOnce();
});
```
#### .toHaveBeenCalledOnceWith()
Use `.toHaveBeenCalledOnceWith` to check if a `Mock` was called exactly one time with the expected value.
```js
it('passes only if mock was called exactly once with the expected value', () => {
const mock = jest.fn();
expect(mock).not.toHaveBeenCalled();
mock('hello');
expect(mock).toHaveBeenCalledOnceWith('hello');
});
```
### Number
#### .toBeNumber()
Use `.toBeNumber` when checking if a value is a `Number`.
```js
test('passes when value is a number', () => {
expect(1).toBeNumber();
expect(NaN).toBeNumber();
expect(Infinity).toBeNumber();
expect(true).not.toBeNumber();
});
```
#### .toBeNaN()
Use `.toBeNaN` when checking a value is `NaN`.
```js
test('passes when value is NaN', () => {
expect(NaN).toBeNaN();
expect(1).not.toBeNaN();
});
```
#### .toBeFinite()
Use `.toBeFinite` when checking if a value is a `Number`, not `NaN` or `Infinity`.
```js
test('passes when value is a finite number', () => {
expect(1).toBeFinite();
expect(Infinity).not.toBeFinite();
expect(NaN).not.toBeFinite();
});
```
#### .toBePositive()
Use `.toBePositive` when checking if a value is a positive `Number`.
```js
test('passes when value is a positive number', () => {
expect(1).toBePositive();
expect(Infinity).not.toBePositive();
expect(-1).not.toBePositive();
expect(NaN).not.toBePositive();
});
```
#### .toBeNegative()
Use `.toBeNegative` when checking if a value is a negative `Number`.
```js
test('passes when value is a negative number', () => {
expect(-1).toBeNegative();
expect(-Infinity).not.toBeNegative();
expect(1).not.toBeNegative();
expect(NaN).not.toBeNegative();
});
```
#### .toBeEven()
Use `.toBeEven` when checking if a value is an even `Number`.
```js
test('passes when value is an even number', () => {
expect(2).toBeEven();
expect(1).not.toBeEven();
expect(NaN).not.toBeEven();
});
```
#### .toBeOdd()
Use `.toBeOdd` when checking if a value is an odd `Number`.
```js
test('passes when value is an odd number', () => {
expect(1).toBeOdd();
expect(2).not.toBeOdd();
expect(NaN).not.toBeOdd();
});
```
#### .toBeWithin(start, end)
Use `.toBeWithin` when checking if a number is in between the given bounds of: start (inclusive) and end (exclusive).
```js
test('passes when number is within given bounds', () => {
expect(1).toBeWithin(1, 3);
expect(2).toBeWithin(1, 3);
expect(3).not.toBeWithin(1, 3);
});
```
#### .toBeInteger()
Use `.toBeInteger` when checking if a number is an integer.
```js
test('passes when value is an integer', () => {
expect(1).toBeInteger();
expect(1.0).toBeInteger();
expect(1.1).not.toBeInteger();
});
```
### Object
#### .toBeEmptyObject()
Use `.toBeEmptyObject` when checking if a value is an empty `Object`.
```js
test('passes when value is an empty object', () => {
expect({}).toBeEmptyObject();
expect({ a: 'hello' }).not.toBeEmptyObject();
});
```
#### .toBeObject()
Use `.toBeObject` when checking if a value is an `Object`.
```js
test('passes when value is an object', () => {
expect({}).toBeObject();
expect({ a: 'hello' }).toBeObject();
expect(true).not.toBeObject();
});
```
#### .toContainKey(key)
Use `.toContainKey` when checking if an object contains the provided key.
```js
test('passes when object contains the given key', () => {
const o = { a: 'foo', b: 'bar', c: 'baz' };
expect(o).toContainKey('a');
expect(o).toContainKey('b');
expect(o).toContainKey('c');
expect(o).not.toContainKey('d');
});
```
#### .toContainKeys([keys])
Use `.toContainKeys` when checking if an object has all of the provided keys.
```js
test('passes when object contains all keys', () => {
const o = { a: 'foo', b: 'bar', c: 'baz' };
expect(o).toContainKeys(['a', 'b']);
expect(o).toContainKeys(['b', 'c']);
expect(o).not.toContainKeys(['d']);
});
```
#### .toContainAllKeys([keys])
Use `.toContainAllKeys` when checking if an object only contains all of the provided keys.
```js
test('passes when object only contains all keys', () => {
const o = { a: 'hello', b: 'world' };
expect(o).toContainAllKeys(['a', 'b']);
expect(o).toContainAllKeys(['b', 'a']);
expect(o).not.toContainAllKeys(['b']);
});
```
#### .toContainAnyKeys([keys])
Use `.toContainAnyKeys` when checking if an object contains at least one of the provided keys.
```js
test('passes when object contains at least one matching key', () => {
const o = { a: 'hello', b: 'world' };
expect(o).toContainAnyKeys(['a']);
expect(o).toContainAnyKeys(['b']);
expect(o).toContainAnyKeys(['b', 'c']);
expect(o).not.toContainAnyKeys(['c']);
});
```
#### .toContainValue(value)
Use `.toContainValue` when checking if an object contains the provided value.
```js
test('passes when object contains given value', () => {
const o = { a: 'foo', b: 'bar', c: 'baz' };
expect(o).toContainValue('foo');
expect(o).toContainValue('bar');
expect(o).not.toContainValue('qux');
});
```
#### .toContainValues([values])
Use `.toContainValues` when checking if an object contains all of the provided values.
```js
test('passes when object contains all of the given values', () => {
const o = { a: 'foo', b: 'bar', c: 'baz' };
expect(o).toContainValues(['foo']);
expect(o).toContainValues(['baz', 'bar']);
expect(o).not.toContainValues(['qux', 'foo']);
});
```
#### .toContainAllValues([values])
Use `.toContainAllValues` when checking if an object only contains all of the provided values.
```js
test('passes when object only contains all of the given values', () => {
const o = { a: 'foo', b: 'bar', c: 'baz' };
expect(o).toContainAllValues(['foo', 'bar', 'baz']);
expect(o).toContainAllValues(['baz', 'bar', 'foo']);
expect(o).not.toContainAllValues(['bar', 'foo']);
});
```
#### .toContainAnyValues([values])
Use `.toContainAnyValues` when checking if an object contains at least one of the provided values.
```js
test('passes when object contains at least one of the given values', () => {
const o = { a: 'foo', b: 'bar', c: 'baz' };
expect(o).toContainAnyValues(['qux', 'foo']);
expect(o).toContainAnyValues(['qux', 'bar']);
expect(o).toContainAnyValues(['qux', 'baz']);
expect(o).not.toContainAnyValues(['qux']);
});
```
#### .toContainEntry([key, value])
Use `.toContainEntry` when checking if an object contains the provided entry.
```js
test('passes when object contains given entry', () => {
const o = { a: 'foo', b: 'bar', c: 'baz' };
expect(o).toContainEntry(['a', 'foo']);
expect(o).toContainEntry(['b', 'bar']);
expect(o).toContainEntry(['c', 'baz']);
expect(o).not.toContainEntry(['a', 'qux']);
});
```
#### .toContainEntries([[key, value]])
Use `.toContainEntries` when checking if an object contains all of the provided entries.
```js
test('passes when object contains all of the given entries', () => {
const o = { a: 'foo', b: 'bar', c: 'baz' };
expect(o).toContainEntries([['a', 'foo']]);
expect(o).toContainEntries([
['c', 'baz'],
['a', 'foo'],
]);
expect(o).not.toContainEntries([
['b', 'qux'],
['a', 'foo'],
]);
});
```
#### .toContainAllEntries([[key, value]])
Use `.toContainAllEntries` when checking if an object only contains all of the provided entries.
```js
test('passes when object only contains all of the given entries', () => {
const o = { a: 'foo', b: 'bar', c: 'baz' };
expect(o).toContainAllEntries([
['a', 'foo'],
['b', 'bar'],
['c', 'baz'],
]);
expect(o).not.toContainAllEntries([
['a', 'foo'],
['b', 'bar'],
]);
});
```
#### .toContainAnyEntries([[key, value]])
Use `.toContainAnyEntries` when checking if an object contains at least one of the provided entries.
```js
test('passes when object contains at least one of the given entries', () => {
const o = { a: 'foo', b: 'bar', c: 'baz' };
expect(o).toContainAnyEntries([
['a', 'qux'],
['a', 'foo'],
]);
expect(o).toContainAnyEntries([
['a', 'qux'],
['b', 'bar'],
]);
expect(o).toContainAnyEntries([
['a', 'qux'],
['c', 'baz'],
]);
expect(o).not.toContainAnyEntries([['d', 'qux']]);
});
```
#### .toBeExtensible()
Use `.toBeExtensible` when checking if an object is extensible.
```js
test('passes when value is extensible', () => {
expect({ a: 1 }).toBeExtensible();
expect(1).not.toBeExtensible();
});
```
#### .toBeFrozen()
Use `.toBeFrozen` when checking if an object is frozen.
```js
test('passes when value is frozen', () => {
expect(Object.frozen({})).toBeFrozen();
expect({}).not.toBeFrozen();
expect(1).not.toBeFrozen();
});
```
#### .toBeSealed()
Use `.toBeSealed` when checking if an object is sealed.
```js
test('passes when value is sealed', () => {
expect(Object.seal({})).toBeSealed();
expect({}).not.toBeSealed();
expect(1).not.toBeSealed();
});
```
### Promise
#### .toResolve()
Use `.toResolve` when checking if a promise is resolved.
```js
test('passes when a promise resolves', async () => {
await expect(Promise.resolve()).toResolve();
});
```
#### .toReject()
Use `.toReject` when checking if a promise is rejected.
```js
test('passes when a promise rejects', async () => {
await expect(Promise.reject()).toReject();
});
```
### String
#### .toBeString()
Use `.toBeString` when checking if a value is a `String`.
```js
test('passes when value is a string', () => {
expect('').toBeString();
expect('hello').toBeString();
expect(new String('hello')).toBeString();
expect(true).not.toBeString();
});
```
#### .toBeHexadecimal(string)
Use `.toBeHexadecimal` when checking if a value is a valid HTML hexadecimal color.
```js
test('passes when value is a valid hexadecimal', () => {
expect('#abc123').toBeHexadecimal();
expect('#FFF').toBeHexadecimal();
expect('#000000').toBeHexadecimal();
expect('#123ffg').not.toBeHexadecimal();
});
```
#### .toBeDateString(string)
Use `.toBeDateString` when checking if a value is a valid date string.
```js
test('passes when value is a valid toBeDateString', () => {
expect('2019-11-27T14:05:07.520Z').toBeDateString();
expect('11/12/21').toBeDateString();
expect('not a date').not.toBeDateString();
});
```
#### .toEqualCaseInsensitive(string)
Use `.toEqualCaseInsensitive` when checking if a string is equal (===) to another ignoring the casing of both strings.
```js
test('passes when strings are equal ignoring case', () => {
expect('hello world').toEqualCaseInsensitive('hello world');
expect('hello WORLD').toEqualCaseInsensitive('HELLO world');
expect('HELLO WORLD').toEqualCaseInsensitive('hello world');
expect('hello world').toEqualCaseInsensitive('HELLO WORLD');
expect('hello world').not.toEqualCaseInsensitive('hello');
});
```
#### .toStartWith(prefix)
Use `.toStartWith` when checking if a `String` starts with a given `String` prefix.
```js
test('passes when value is starts with given string', () => {
expect('hello world').toStartWith('hello');
expect('hello world').not.toStartWith('world');
});
```
#### .toEndWith(suffix)
Use `.toEndWith` when checking if a `String` ends with a given `String` suffix.
```js
test('passes when value is ends with given string', () => {
expect('hello world').toEndWith('world');
expect('hello world').not.toEndWith('hello');
});
```
#### .toInclude(substring)
Use `.toInclude` when checking if a `String` includes the given `String` substring.
```js
test('passes when value includes substring', () => {
expect('hello world').toInclude('ell');
expect('hello world').not.toInclude('bob');
});
```
#### .toIncludeRepeated(substring, times)
Use `.toIncludeRepeated` when checking if a `String` includes the given `String` substring the correct number of times.
```js
test('passes when value includes substring n times', () => {
expect('hello hello world').toIncludeRepeated('hello', 2);
expect('hello hello world').not.toIncludeRepeated('hello', 1);
});
```
#### .toIncludeMultiple([substring])
Use `.toIncludeMultiple` when checking if a `String` includes all of the given substrings.
```js
test('passes when value includes all substrings', () => {
expect('hello world').toIncludeMultiple(['world', 'hello']);
expect('hello world').not.toIncludeMultiple(['world', 'hello', 'bob']);
});
```
#### .toEqualIgnoringWhitespace(string)
Use `.toEqualIgnoringWhitespace` when checking if a `String` is equal to another `String` ignoring white-space.
```js
test('passes if strings are equal ignoring white-space', () => {
expect('hello world').toEqualIgnoringWhitespace(`
hello
world
`);
expect('SELECT * FROM TABLE WHERE CONDITION').toEqualIgnoringWhitespace(`
SELECT * FROM TABLE
WHERE CONDITION
`);
expect('.class { cssRule: value }').not.toEqualIgnoringWhitespace(`
#id {
cssRule: value
}
`);
});
```
### Symbol
#### .toBeSymbol()
Use `.toBeSymbol` when checking if a value is a `Symbol`.
```js
test('passes when value is a symbol', () => {
expect(Symbol()).toBeSymbol();
expect(true).not.toBeSymbol();
});
```
## LICENSE
[MIT](/LICENSE)

@@ -177,3 +177,3 @@ /* eslint-disable @typescript-eslint/no-explicit-any */

*/
toHaveBeenCalledOnceWith(): R;
toHaveBeenCalledOnceWith(arg: unknown): R;

@@ -224,2 +224,10 @@ /**

/**
* Use `.toBeInRange` when checking if an array has elements in range min (inclusive) and max (inclusive).
*
* @param min
* @param max
*/
toBeInRange(min: number, max: number): R;
/**
* Use `.toBeInteger` when checking if a value is an integer.

@@ -442,7 +450,2 @@ */

type Result = {
pass: boolean;
message(): string;
};
// noinspection JSUnusedGlobalSymbols

@@ -456,3 +459,3 @@ interface Expect {

*/
pass(message: string): Result;
pass(message: string): any;

@@ -465,3 +468,3 @@ /**

*/
fail(message: string): Result;
fail(message: string): any;

@@ -471,3 +474,3 @@ /**

*/
toBeEmpty(): Result;
toBeEmpty(): any;

@@ -478,3 +481,3 @@ /**

*/
toBeOneOf<E = unknown>(members: readonly E[]): Result;
toBeOneOf<E = unknown>(members: readonly E[]): any;

@@ -484,3 +487,3 @@ /**

*/
toBeNil(): Result;
toBeNil(): any;

@@ -491,3 +494,3 @@ /**

*/
toSatisfy<E = any>(predicate: (x: E) => boolean): Result;
toSatisfy<E = any>(predicate: (x: E) => boolean): any;

@@ -497,3 +500,3 @@ /**

*/
toBeArray(): Result;
toBeArray(): any;

@@ -504,3 +507,3 @@ /**

*/
toBeArrayOfSize(x: number): Result;
toBeArrayOfSize(x: number): any;

@@ -511,3 +514,3 @@ /**

*/
toBeAfter(date: Date): Result;
toBeAfter(date: Date): any;

@@ -518,3 +521,3 @@ /**

*/
toBeBefore(date: Date): Result;
toBeBefore(date: Date): any;

@@ -525,3 +528,3 @@ /**

*/
toIncludeAllMembers<E = unknown>(members: readonly E[]): Result;
toIncludeAllMembers<E = unknown>(members: readonly E[]): any;

@@ -532,3 +535,3 @@ /**

*/
toIncludeAnyMembers<E = unknown>(members: readonly E[]): Result;
toIncludeAnyMembers<E = unknown>(members: readonly E[]): any;

@@ -539,3 +542,3 @@ /**

*/
toIncludeSameMembers<E = unknown>(members: readonly E[]): Result;
toIncludeSameMembers<E = unknown>(members: readonly E[]): any;

@@ -546,3 +549,3 @@ /**

*/
toPartiallyContain<E = unknown>(member: E): Result;
toPartiallyContain<E = unknown>(member: E): any;

@@ -553,3 +556,3 @@ /**

*/
toSatisfyAll<E = any>(predicate: (x: E) => boolean): Result;
toSatisfyAll<E = any>(predicate: (x: E) => boolean): any;

@@ -560,3 +563,3 @@ /**

*/
toSatisfyAny(predicate: (x: any) => boolean): Result;
toSatisfyAny(predicate: (x: any) => boolean): any;

@@ -566,3 +569,3 @@ /**

*/
toBeBoolean(): Result;
toBeBoolean(): any;

@@ -572,3 +575,3 @@ /**

*/
toBeTrue(): Result;
toBeTrue(): any;

@@ -578,3 +581,3 @@ /**

*/
toBeFalse(): Result;
toBeFalse(): any;

@@ -584,3 +587,3 @@ /**

*/
toBeDate(): Result;
toBeDate(): any;

@@ -590,3 +593,3 @@ /**

*/
toBeValidDate(): Result;
toBeValidDate(): any;

@@ -596,3 +599,3 @@ /**

*/
toBeFunction(): Result;
toBeFunction(): any;

@@ -602,3 +605,3 @@ /**

*/
toBeDateString(): Result;
toBeDateString(): any;

@@ -608,3 +611,3 @@ /**

*/
toBeHexadecimal(): Result;
toBeHexadecimal(): any;

@@ -619,3 +622,3 @@ /**

*/
toHaveBeenCalledBefore(mock: jest.MockInstance<unknown, unknown[]>, failIfNoSecondInvocation: boolean): Result;
toHaveBeenCalledBefore(mock: jest.MockInstance<unknown, unknown[]>, failIfNoSecondInvocation: boolean): any;

@@ -630,3 +633,3 @@ /**

*/
toHaveBeenCalledAfter(mock: jest.MockInstance<unknown, unknown[]>, failIfNoFirstInvocation: boolean): Result;
toHaveBeenCalledAfter(mock: jest.MockInstance<unknown, unknown[]>, failIfNoFirstInvocation: boolean): any;

@@ -636,3 +639,3 @@ /**

*/
toHaveBeenCalledOnce(): Result;
toHaveBeenCalledOnce(): any;

@@ -642,3 +645,3 @@ /**

*/
toHaveBeenCalledOnceWith(): Result;
toHaveBeenCalledOnceWith(): any;

@@ -648,3 +651,3 @@ /**

*/
toBeNumber(): Result;
toBeNumber(): any;

@@ -654,3 +657,3 @@ /**

*/
toBeNaN(): Result;
toBeNaN(): any;

@@ -660,3 +663,3 @@ /**

*/
toBeFinite(): Result;
toBeFinite(): any;

@@ -666,3 +669,3 @@ /**

*/
toBePositive(): Result;
toBePositive(): any;

@@ -672,3 +675,3 @@ /**

*/
toBeNegative(): Result;
toBeNegative(): any;

@@ -678,3 +681,3 @@ /**

*/
toBeEven(): Result;
toBeEven(): any;

@@ -684,3 +687,3 @@ /**

*/
toBeOdd(): Result;
toBeOdd(): any;

@@ -693,8 +696,16 @@ /**

*/
toBeWithin(start: number, end: number): Result;
toBeWithin(start: number, end: number): any;
/**
* Use `.toBeInRange` when checking if an array has elements in range min (inclusive) and max (inclusive).
*
* @param min
* @param max
*/
toBeInRange(min: number, max: number): any;
/**
* Use `.toBeObject` when checking if a value is an `Object`.
*/
toBeObject(): Result;
toBeObject(): any;

@@ -706,3 +717,3 @@ /**

*/
toContainKey(key: string): Result;
toContainKey(key: string): any;

@@ -714,3 +725,3 @@ /**

*/
toContainKeys<E = unknown>(keys: readonly (keyof E | string)[]): Result;
toContainKeys<E = unknown>(keys: readonly (keyof E | string)[]): any;

@@ -722,3 +733,3 @@ /**

*/
toContainAllKeys<E = unknown>(keys: readonly (keyof E | string)[]): Result;
toContainAllKeys<E = unknown>(keys: readonly (keyof E | string)[]): any;

@@ -730,3 +741,3 @@ /**

*/
toContainAnyKeys<E = unknown>(keys: readonly (keyof E | string)[]): Result;
toContainAnyKeys<E = unknown>(keys: readonly (keyof E | string)[]): any;

@@ -738,3 +749,3 @@ /**

*/
toContainValue<E = unknown>(value: E): Result;
toContainValue<E = unknown>(value: E): any;

@@ -746,3 +757,3 @@ /**

*/
toContainValues<E = unknown>(values: readonly E[]): Result;
toContainValues<E = unknown>(values: readonly E[]): any;

@@ -754,3 +765,3 @@ /**

*/
toContainAllValues<E = unknown>(values: readonly E[]): Result;
toContainAllValues<E = unknown>(values: readonly E[]): any;

@@ -762,3 +773,3 @@ /**

*/
toContainAnyValues<E = unknown>(values: readonly E[]): Result;
toContainAnyValues<E = unknown>(values: readonly E[]): any;

@@ -770,3 +781,3 @@ /**

*/
toContainEntry<E = unknown>(entry: readonly [keyof E, E[keyof E]]): Result;
toContainEntry<E = unknown>(entry: readonly [keyof E, E[keyof E]]): any;

@@ -778,3 +789,3 @@ /**

*/
toContainEntries<E = unknown>(entries: readonly (readonly [keyof E, E[keyof E]])[]): Result;
toContainEntries<E = unknown>(entries: readonly (readonly [keyof E, E[keyof E]])[]): any;

@@ -786,3 +797,3 @@ /**

*/
toContainAllEntries<E = unknown>(entries: readonly (readonly [keyof E, E[keyof E]])[]): Result;
toContainAllEntries<E = unknown>(entries: readonly (readonly [keyof E, E[keyof E]])[]): any;

@@ -794,3 +805,3 @@ /**

*/
toContainAnyEntries<E = unknown>(entries: readonly (readonly [keyof E, E[keyof E]])[]): Result;
toContainAnyEntries<E = unknown>(entries: readonly (readonly [keyof E, E[keyof E]])[]): any;

@@ -800,3 +811,3 @@ /**

*/
toBeExtensible(): Result;
toBeExtensible(): any;

@@ -806,3 +817,3 @@ /**

*/
toBeFrozen(): Result;
toBeFrozen(): any;

@@ -812,3 +823,3 @@ /**

*/
toBeSealed(): Result;
toBeSealed(): any;

@@ -818,3 +829,3 @@ /**

*/
toResolve(): Result;
toResolve(): any;

@@ -824,3 +835,3 @@ /**

*/
toReject(): Result;
toReject(): any;

@@ -830,3 +841,3 @@ /**

*/
toBeString(): Result;
toBeString(): any;

@@ -838,3 +849,3 @@ /**

*/
toEqualCaseInsensitive(string: string): Result;
toEqualCaseInsensitive(string: string): any;

@@ -846,3 +857,3 @@ /**

*/
toStartWith(prefix: string): Result;
toStartWith(prefix: string): any;

@@ -854,3 +865,3 @@ /**

*/
toEndWith(suffix: string): Result;
toEndWith(suffix: string): any;

@@ -862,3 +873,3 @@ /**

*/
toInclude(substring: string): Result;
toInclude(substring: string): any;

@@ -871,3 +882,3 @@ /**

*/
toIncludeRepeated(substring: string, times: number): Result;
toIncludeRepeated(substring: string, times: number): any;

@@ -879,3 +890,3 @@ /**

*/
toIncludeMultiple(substring: readonly string[]): Result;
toIncludeMultiple(substring: readonly string[]): any;

@@ -888,3 +899,3 @@ /**

*/
toThrowWithMessage(type: (...args: any[]) => any, message: string | RegExp): Result;
toThrowWithMessage(type: (...args: any[]) => any, message: string | RegExp): any;

@@ -894,3 +905,3 @@ /**

*/
toBeEmptyObject(): Result;
toBeEmptyObject(): any;

@@ -900,3 +911,3 @@ /**

*/
toBeSymbol(): Result;
toBeSymbol(): any;

@@ -908,3 +919,3 @@ /**

*/
toBeBetween(startDate: Date, endDate: Date): Result;
toBeBetween(startDate: Date, endDate: Date): any;

@@ -915,3 +926,3 @@ /**

*/
toBeBeforeOrEqualTo(date: Date): Result;
toBeBeforeOrEqualTo(date: Date): any;

@@ -922,3 +933,3 @@ /**

*/
toBeAfterOrEqualTo(date: Date): Result;
toBeAfterOrEqualTo(date: Date): any;

@@ -930,3 +941,3 @@ /**

*/
toEqualIgnoringWhitespace(string: string): Result;
toEqualIgnoringWhitespace(string: string): any;
}

@@ -933,0 +944,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc