* Executes a callback function passing in `response` object and assert * Use it to perform custom checks of response data * * ```js * I.seeResponseValidByCallback(({ data, status }) => { * assert.strictEqual(status, 200); * assert('user' in data); * assert('company' in dat
(fn)
| 272 | * @param {function} fn |
| 273 | */ |
| 274 | seeResponseValidByCallback(fn) { |
| 275 | this._checkResponseReady() |
| 276 | fn({ ...this.response, assert }) |
| 277 | const body = fn.toString() |
| 278 | fn.toString = () => `${body.split('\n')[1]}...` |
| 279 | } |
| 280 | |
| 281 | /** |
| 282 | * Checks that response data equals to expected: |
no test coverage detected