[mochawesome] Error adding context: Invalid test object.
See original GitHub issueHi, will putting add context in file it gives error: [mochawesome] Error adding context: Invalid test object.
Sample code:
var addContext = require('mochawesome/addContext');
var expect = require("chai");
var assert = require('assert');
var uuid = require('uuid/v1');
describe("scenario",function () {
it('testcase', function () {
return promise.then(function(result)){
///some code
addContext(this, 'Test Case yet to be implement');
})
})
})
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
mochawesome/general - Gitter
I've tried without => and I don't get the [mochawesome] Error adding context: Invalid test object. but it doesn't add anything to the...
Read more >How to add images to mochawesome report using Codeceptjs?
I think the this object you're looking for is this.ctx in Codeceptjs. Try with addContext(this.ctx, imagePath).
Read more >Code coverage report for node-npmtest-mochawesome ...
INVALID_CONTEXT : errorPrefix + ' Expected a string or an object of shape ... 'value'); } /** * Add context to the test...
Read more >mochawesome - npm
mocha tests --reporter mochawesome --require mochawesome/register ... Context passed as an object must adhere to the following shape:.
Read more >Reporters - CodeceptJS
Test names and failures will be printed out on screen. ... Also if you will add Mochawesome helper, then you will able to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Your
this
inside thethen
function doesn’t refer to the test object. You need to save a reference to it first. Like so:Sure thanks @adamgruber , it worked! it(‘Verify creation of Shifts for all Hospital type facility roles’, async function(){ addContext(_this, ‘Blah blah blah’); }