codeceptjs-chai
Advanced tools
+11
-0
@@ -241,2 +241,13 @@ export = chaiWrapper; | ||
| assertDeepIncludeMembers(actualValue: any, expectedValue: any, customErrorMsg?: any): any; | ||
| /** | ||
| * Asserts a JSON deep compare excluding some properties of the JSON object | ||
| * https://www.npmjs.com/package/chai-exclude | ||
| * https://github.com/mesaugat/chai-exclude/blob/add7356daec42291c91e4b2f1598ed1b3782e5a6/index.d.ts#L32 * | ||
| * @param {*} actualValue | ||
| * @param {*} expectedValue | ||
| * @param {*} fieldsToExclude | ||
| * @param {*} customErrorMsg | ||
| * @returns {*} | ||
| */ | ||
| assertDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude:any, customErrorMsg?: any): any; | ||
| } |
+31
-14
@@ -6,4 +6,5 @@ /* eslint-disable global-require */ | ||
| // Use chai custom assetion library | ||
| // Use chai custom assertion library | ||
| chai.use( require( 'chai-string' ) ); | ||
| chai.use( require( 'chai-exclude' ) ); | ||
@@ -181,3 +182,3 @@ /** | ||
| */ | ||
| assertJsonSchemaUsingAJV( | ||
| assertJsonSchemaUsingAJV( | ||
| targetData, | ||
@@ -365,6 +366,6 @@ jsonSchema, | ||
| * https://www.npmjs.com/package/chai-string#equalignorecase | ||
| * @param {*} actualValue | ||
| * @param {*} expectedValue | ||
| * @param {*} customErrorMsg | ||
| * @returns | ||
| * @param {*} actualValue | ||
| * @param {*} expectedValue | ||
| * @param {*} customErrorMsg | ||
| * @returns | ||
| */ | ||
@@ -380,6 +381,6 @@ assertEqualIgnoreCase( actualValue, expectedValue, customErrorMsg = '' ){ | ||
| * https://www.chaijs.com/api/bdd/#method_deep | ||
| * @param {*} actualValue | ||
| * @param {*} expectedValue | ||
| * @param {*} customErrorMsg | ||
| * @returns | ||
| * @param {*} actualValue | ||
| * @param {*} expectedValue | ||
| * @param {*} customErrorMsg | ||
| * @returns | ||
| */ | ||
@@ -395,6 +396,6 @@ assertDeepMembers( actualValue, expectedValue, customErrorMsg = '' ){ | ||
| * https://www.chaijs.com/api/bdd/#method_deep | ||
| * @param {*} actualValue | ||
| * @param {*} expectedValue | ||
| * @param {*} customErrorMsg | ||
| * @returns | ||
| * @param {*} actualValue | ||
| * @param {*} expectedValue | ||
| * @param {*} customErrorMsg | ||
| * @returns | ||
| */ | ||
@@ -407,4 +408,20 @@ assertDeepIncludeMembers( actualValue, expectedValue, customErrorMsg = '' ){ | ||
| /** | ||
| * https://www.chaijs.com/api/bdd/#method_deep | ||
| * https://www.chaijs.com/plugins/chai-exclude/ | ||
| * https://www.chaijs.com/api/bdd/#method_equal | ||
| * @param {*} actualValue | ||
| * @param {*} expectedValue | ||
| * @param {*} fieldsToExclude | ||
| * @param {*} customErrorMsg | ||
| * @returns {*} | ||
| */ | ||
| assertDeepEqualExcluding( actualValue, expectedValue, fieldsToExclude, customErrorMsg = '' ){ | ||
| return expect( actualValue, customErrorMsg ).excludingEvery( fieldsToExclude ).to.deep.equal( expectedValue ); | ||
| } | ||
| } | ||
| module.exports = chaiWrapper; |
+3
-2
| { | ||
| "name": "codeceptjs-chai", | ||
| "version": "2.3.2", | ||
| "version": "2.3.3", | ||
| "description": "CodeceptJS helper for chai library", | ||
@@ -16,2 +16,3 @@ "devDependencies": { | ||
| "chai": "^4.2.0", | ||
| "chai-exclude": "^2.1.0", | ||
| "chai-json-schema": "^1.5.1", | ||
@@ -38,2 +39,2 @@ "chai-json-schema-ajv": "^5.1.0", | ||
| "license": "MIT" | ||
| } | ||
| } |
+21
-3
@@ -616,4 +616,22 @@ # codeceptjs-chai | ||
| - `actualValue` - actual value | ||
| - `expectedValue` - expected value | ||
| - `customErrorMsg` - Custom error message | ||
| - `actualValue` - actual value | ||
| - `expectedValue` - expected value | ||
| - `customErrorMsg` - Custom error message | ||
| ## assertDeepIncludeMembers | ||
| Asserts members of two JSON objects are deeply equal excluding some properties | ||
| https://www.chaijs.com/plugins/chai-exclude/ | ||
| ```js | ||
| I.assertDeepEqualExcluding([{a: 1},{b: 2}],'b',[{a: 1}]) | ||
| ``` | ||
| **Parameters** | ||
| - `actualValue` - actual value | ||
| - `expectedValue` - expected value | ||
| - `fieldsToExclude` - Fields to exclude from validation | ||
| - `customErrorMsg` - Custom error message |
42632
3.77%711
3.64%637
3.07%6
20%+ Added
+ Added
+ Added