codeceptjs-chai
Advanced tools
+32
-0
@@ -126,3 +126,35 @@ /* eslint-disable global-require */ | ||
| /** | ||
| * https://www.npmjs.com/package/chai-string#endswithendwith | ||
| * @param {*} actualValue | ||
| * @param {*} expectedValueToEndWith | ||
| * @param {*} customErrorMsg | ||
| * @returns {*} | ||
| */ | ||
| assertEndsWith( actualValue, expectedValueToEndWith, customErrorMsg = '' ){ | ||
| return expect( actualValue, customErrorMsg ).to.endsWith( | ||
| expectedValueToEndWith, | ||
| ); | ||
| } | ||
| /** | ||
| * https://www.chaijs.com/api/bdd/#method_not | ||
| * https://www.npmjs.com/package/chai-string#endswithendwith | ||
| * @param {*} actualValue | ||
| * @param {*} expectedValueToNotEndWith | ||
| * @param {*} customErrorMsg | ||
| * @returns {*} | ||
| */ | ||
| assertNotEndsWith( actualValue, expectedValueToNotEndWith, customErrorMsg = '' ){ | ||
| return expect( actualValue, customErrorMsg ).not.to.endsWith( | ||
| expectedValueToNotEndWith, | ||
| ); | ||
| } | ||
| /** | ||
| * https://www.npmjs.com/package/chai-json-schema#jsonschemavalue-schema | ||
@@ -129,0 +161,0 @@ * @param {*} targetData |
+1
-1
| { | ||
| "name": "codeceptjs-chai", | ||
| "version": "2.1.1", | ||
| "version": "2.2.0", | ||
| "description": "CodeceptJS helper for chai library", | ||
@@ -5,0 +5,0 @@ "devDependencies": { |
+35
-0
@@ -176,2 +176,37 @@ # codeceptjs-chai | ||
| ## assertEndsWith | ||
| Asserts that the target ends with the given value. | ||
| https://www.npmjs.com/package/chai-string#endswithendwith | ||
| ```js | ||
| I.assertEndsWith('foobar', 'bar'); | ||
| I.assertEndsWith('foobar', 'bar', 'Target value does not ends with given value'); | ||
| ``` | ||
| **Parameters** | ||
| - `actualValue` - actual value | ||
| - `expectedValueToEndWith` - expected value to end with | ||
| - `customErrorMsg` - Custom error message | ||
| ## assertNotEndsWith | ||
| Asserts that the target does not end with the given value. | ||
| - https://www.chaijs.com/api/bdd/#method_not | ||
| - https://www.npmjs.com/package/chai-string#endswithendwith | ||
| ```js | ||
| I.assertNotEndsWith('foobar', 'bar'); | ||
| I.assertNotEndsWith('foobar', 'bar', 'Target value ends with given value'); | ||
| ``` | ||
| **Parameters** | ||
| - `actualValue` - actual value | ||
| - `expectedValueToNotEndWith` - expected value to not end with | ||
| - `customErrorMsg` - Custom error message | ||
| ## assertJsonSchema | ||
@@ -178,0 +213,0 @@ |
30110
6.22%413
6.44%571
6.53%