I'm lost in the Node documentation and I'm having difficulties figuring out how I could create a custom (or modify the existing) error handling for all of my assert statements, without having to include individual messages with each assertion.
const assert = require('assert');
describe('Test 1', function(){
describe('Checks State', function(){
it('will fail', function(){
assert.strictEqual(true, false);
});
});
});
As expected, the previous code would just generate something like:
1) "Test 1 Checks State will fail"
true === false
I'm running with WebDriverIO and my goal is to include the browser.sessionId
in the error message, without having to manually fill in the third (message) parameter on each test.
assert.strictEqual(true, false, browser.sessionId);
It would be ideal if I could generate an error message like:
1) "Test 1 Checks State will fail"
abc012-efg345-hij678-klm901
true !== false
I apologize, I know I should include "what I have done so far" -- but everything I've done so far has had no impact. And again, I'm lost in the node documentation :)