What are you trying to achieve?
I am trying to invoke a custom helper I.methodName(null) method with null argument to assert null value present in one of the json field.
What do you get instead?
Provide console output if related. Use --verbose mode for more details.
Cannot read property 'toString' of null
ypeError: Cannot read property 'toString' of null
at G:\CodeceptJS-Test\node_modules\codeceptjs\lib\step.js:115:22
at Array.map (<anonymous>)
at Step.humanizeArgs (node_modules\codeceptjs\lib\step.js:98:22)
at Step.toString (node_modules\codeceptjs\lib\step.js:133:67)
at Object.emit (node_modules\codeceptjs\lib\event.js:112:24)
Provide test source code if related
My Helper class looks like below:
// eslint-disable-next-line no-undef
const Helper = codecept_helper;
const { expect } = require( 'chai' );
class ChaiExtraHelper extends Helper{
assertNull( data ){
return expect( data ).to.be.null;
}
}
module.exports = ChaiExtraHelper;
My test looks like below:
Details
- CodeceptJS version: 2.6.6
- NodeJS Version: 12.13.0
- Operating System: Windows 10
- puppeteer || webdriverio || protractor || testcafe version (if related)
What are you trying to achieve?
I am trying to invoke a custom helper
I.methodName(null)method with null argument to assert null value present in one of the json field.What do you get instead?
My Helper class looks like below:
My test looks like below:
Details