-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
format: change message formatter to output NDJSON instead of binary (#…
…1295) * emit ndjson from message formatter * update cli documentation * get everything passing with ndjson * no need to write message output as json as well * add module def for ndjson-parse
- Loading branch information
1 parent
0f9414b
commit 88532ac
Showing
6 changed files
with
17 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
import Formatter, { IFormatterOptions } from '.' | ||
import { messages } from 'cucumber-messages' | ||
import IEnvelope = messages.IEnvelope | ||
|
||
export default class MessageFormatter extends Formatter { | ||
constructor(options: IFormatterOptions) { | ||
super(options) | ||
options.eventBroadcaster.on('envelope', (envelope: IEnvelope) => | ||
this.log(messages.Envelope.encodeDelimited(envelope).finish()) | ||
options.eventBroadcaster.on('envelope', (envelope: messages.Envelope) => | ||
this.log(JSON.stringify(envelope.toJSON()) + '\n') | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
declare module 'ndjson-parse' { | ||
export default function parse(input: string): any[] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters