10.0.0 • Published 4 years ago
@cucumber/json-to-messages v10.0.0
cucumber/json-to-messages
A library to translate legacy JSON output from various cucumber implementations to
cucumber-messages.
Currently supports output from:
behavecucumber-javacucumber-javascriptcucumber-ruby
Installing
You can install this tool using npm:
npm install @cucumber/json-to-messagesUsing the CLI
Send the content of your json file to the CLI:
cat my_report.json | ./node_modules/.bin/json-to-messages > my_report.ndjsonBy default, the tool will detect the cucumber implementation used to generate the report but you can specify it manually:
cat my_report.json | ./node_modules/.bin/json-to-messages --implementation cucumber-js > my_report.ndjsonUsing as a library
import { jsonToMessages } from '@cucumber/json-to-messages'
const JSONs: Readable = ... // The JSON reports to translate
const outputStream: Writable = ... // A stream to write the messages to
jsonToMessages(JSONs, outputStream)