chai-exclude
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -14,2 +14,26 @@ /// <reference types="chai" /> | ||
} | ||
interface Assert { | ||
/** | ||
* Asserts that actual is deeply equal to expected excluding some top level properties. | ||
* | ||
* @type T Type of the objects. | ||
* @param actual Actual value. | ||
* @param expected Potential expected value. | ||
* @param props Properties or keys to exclude. | ||
* @param message Message to display on error. | ||
*/ | ||
deepEqualExcluding<T>(actual: T, expected: T, props: string | string[], message?: string): void; | ||
/** | ||
* Asserts that actual is deeply equal to expected excluding properties any level deep. | ||
* | ||
* @type T Type of the objects. | ||
* @param actual Actual value. | ||
* @param expected Potential expected value. | ||
* @param props Properties or keys to exclude. | ||
* @param message Message to display on error. | ||
*/ | ||
deepEqualExcludingEvery<T>(actual: T, expected: T, props: string | string[], message?: string): void; | ||
} | ||
} |
@@ -126,4 +126,4 @@ module.exports = (chai, utils) => { | ||
*/ | ||
utils.addMethod(assert, 'deepEqualExcluding', function (act, exp, props, msg) { | ||
new Assertion(act, msg).excluding(props).to.deep.equal(exp) | ||
utils.addMethod(assert, 'deepEqualExcluding', function (actual, expected, props, message) { | ||
new Assertion(actual, message).excluding(props).to.deep.equal(expected) | ||
}) | ||
@@ -134,4 +134,4 @@ | ||
*/ | ||
utils.addMethod(assert, 'deepEqualExcludingEvery', function (act, exp, props, msg) { | ||
new Assertion(act, msg).excludingEvery(props).to.deep.equal(exp) | ||
utils.addMethod(assert, 'deepEqualExcludingEvery', function (actual, expected, props, message) { | ||
new Assertion(actual, message).excludingEvery(props).to.deep.equal(expected) | ||
}) | ||
@@ -138,0 +138,0 @@ |
{ | ||
"name": "chai-exclude", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Exclude keys to compare from a deep equal operation with chai expect and assert", | ||
@@ -5,0 +5,0 @@ "main": "lib/chai-exclude.js", |
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
13262
193