Cucumber-js: Is JsonFormatter exported correctly?

Created on 21 Feb 2017  路  7Comments  路  Source: cucumber/cucumber-js

I am trying to use JsonFormatterto generate cucumber Json reports with new cucumber 2.0 rc7 but not able to succeed, I understand that it is a child class of Formatter which is exported as a default class.
I could not find any examples in the doc section as well. An example would definitely help the users on how to use/require different formatters with new version.
Thanks,

Most helpful comment

@emy14 I have been using that module but it generates Json reports by passing cucumber command line option -f <JSON:path>. I want to use JsonFormatter class of cucumber2.0 rc7 and invoke it in my code to generate json reports, thanks for replying though!

@charlierudolph Your insights would help here!

All 7 comments

I used a module : cucumber html reporter https://www.npmjs.com/package/cucumber-html-reporter. Don't know if it's what you're looking for :$

@emy14 I have been using that module but it generates Json reports by passing cucumber command line option -f <JSON:path>. I want to use JsonFormatter class of cucumber2.0 rc7 and invoke it in my code to generate json reports, thanks for replying though!

@charlierudolph Your insights would help here!

The JsonFormatter is not currently exposed. It could easily be though. I believe it would just need an update in https://github.com/cucumber/cucumber-js/blob/998e81d9de63c0e73bd5fa496432626557501338/src/index.js. Should be exported in a very similar way to the SummaryFormatter is you'd like to send a PR

@charlierudolph Thanks for the confirmation and the commit :+1: would there be a patch release soon?

Yep I'll try and release today. I'll comment here when it's released

Fix released in v2.0.0-rc.8

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dblooman picture dblooman  路  7Comments

lamartire picture lamartire  路  6Comments

bmsoko picture bmsoko  路  7Comments

zanona picture zanona  路  4Comments

nicojs picture nicojs  路  3Comments