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

jest-extended

Package Overview
Dependencies
Maintainers
2
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-extended - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

dist/.DS_Store

10

dist/matchers/index.js

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

});
Object.defineProperty(exports, "toPartiallyContain", {
enumerable: true,
get: function () {
return _toPartiallyContain.toPartiallyContain;
}
});
Object.defineProperty(exports, "toReject", {

@@ -550,2 +556,4 @@ enumerable: true,

var _toEqualIgnoringWhitespace = require("./toEqualIgnoringWhitespace");
var _toEqualIgnoringWhitespace = require("./toEqualIgnoringWhitespace");
var _toPartiallyContain = require("./toPartiallyContain");

6

dist/matchers/toContainAllEntries/predicate.js

@@ -8,4 +8,6 @@ "use strict";

var _utils = require("../../utils");
var _predicate = _interopRequireDefault(require("../toContainEntries/predicate"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _default = (obj, entries) => {

@@ -16,5 +18,5 @@ if (!obj.hasOwnProperty || entries.length != Object.keys(obj).length) {

return entries.every(([key, value]) => Object.prototype.hasOwnProperty.call(obj, key) && (0, _utils.equals)(obj[key], value));
return (0, _predicate.default)(obj, entries);
};
exports.default = _default;

@@ -8,6 +8,8 @@ "use strict";

var _utils = require("../../utils");
var _predicate = _interopRequireDefault(require("../toContainEntry/predicate"));
var _default = (obj, entries) => entries.every(([key, value]) => Object.prototype.hasOwnProperty.call(obj, key) && (0, _utils.equals)(obj[key], value));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _default = (obj, entries) => entries.every(entry => (0, _predicate.default)(obj, entry));
exports.default = _default;

@@ -8,3 +8,3 @@ "use strict";

var _predicate = _interopRequireDefault(require("../toContainAnyEntries/predicate"));
var _predicate = _interopRequireDefault(require("../toContainEntries/predicate"));

@@ -11,0 +11,0 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

{
"name": "jest-extended",
"version": "1.1.0",
"version": "1.2.0",
"description": "Additional Jest matchers",

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

"jest-watch-typeahead": "^1.0.0",
"lint-staged": "^11.0.0",
"lint-staged": "^12.0.0",
"prettier": "^2.3.2",

@@ -54,0 +54,0 @@ "pretty-format": "^27.2.4",

@@ -56,2 +56,3 @@ <div align="center">

- [.toIncludeSameMembers([members])](#toincludesamemembersmembers)
- [.toPartiallyContain(member)](#topartiallycontain)
- [.toSatisfyAll(predicate)](#tosatisfyallpredicate)

@@ -356,2 +357,14 @@ - [.toSatisfyAny(predicate)](#tosatisfyanypredicate)

#### .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)

@@ -358,0 +371,0 @@

@@ -134,14 +134,10 @@ /// <reference types="jest" />

/**
* Use `.toBeDateString` when checking if a value is a valid date string.
*
* @param {String} string
*/
toBeDateString(string: string): R;
* Use `.toBeDateString` when checking if a value is a valid date string.
*/
toBeDateString(): R;
/**
* Use `.toBeHexadecimal` when checking if a value is a valid HTML hex color.
*
* @param {String} string
*/
toBeHexadecimal(string: string): R;
toBeHexadecimal(): R;

@@ -418,3 +414,3 @@ /**

*/
toEqualIgnoringWhitespace(string: string): R;
toEqualIgnoringWhitespace(string: string): R;
}

@@ -546,14 +542,10 @@

/**
* Use `.toBeDateString` when checking if a value is a valid date string.
*
* @param {String} string
*/
toBeDateString(string: string): any;
* Use `.toBeDateString` when checking if a value is a valid date string.
*/
toBeDateString(): any;
/**
* Use `.toBeHexadecimal` when checking if a value is a valid HTML hex color.
*
* @param {String} string
*/
toBeHexadecimal(string: string): any;
toBeHexadecimal(): any;

@@ -830,4 +822,4 @@ /**

*/
toEqualIgnoringWhitespace(string: string): any;
toEqualIgnoringWhitespace(string: string): any;
}
}
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