Closed jdewit closed 10 years ago
Hmmm not seen it before, can you provide any more info?
I just tried again on a fresh express-seed app and it works as expected. Looks awesome. Sorry for the bother.
This error happens if you console.log something in your cucumber step definitions.
I'm wondering if there is a way to tell the difference between report output from cucumberjs & console logging.
If so, we could print out the log in the right spot in the report and not have the test run fail.
Cool, let me have a look. Will get back to you.
I know why it's happening, just thinking of a decent solution now.
cucumber.on('close', function (code) {
var stdout = Buffer.concat(_.last(buffer));
if(code != 0) {
grunt.log.error('failed tests, please see the output');
(config.format === 'html') ? publish(JSON.parse(stdout)) : grunt.log.write(stdout);
return done(false);
}
publish(JSON.parse(stdout));
return done();
});
specifically
publish(JSON.parse(stdout));
Problem is that console statements mix with the stdout of cucumber.js JSON output. Not sure what to do yet... any suggestions?
Stripping out the console statements from the stdout does not appear easy. We do know what the json structure should look like so it may be possible with some crazy string parsing.
I haven't looked much into the cucumberjs source but I wonder if the console statements could be handled separately.
Turns out it was easy. Cucumberjs outputs the console statements before the json report.
All I had to do was find the point where the cucumber report data starts and split the output.
@jdewit just published this now as 0.3.0
.
Any idea why this may be happening?