import {StreamReporter} from '@serenity-js/core/lib/stage/crew/stream-reporter'
StreamReporter
Serialises all the DomainEvent objects it receives and streams them as ndjson to the output stream.
Implements:
Examples:
import { configure, StreamReporter } from '@serenity-js/core';
configure({
crew: [
new StreamReporter(process.stdout)
],
});
import { configure, StreamReporter } from '@serenity-js/core';
import fs = require('fs');
configure({
crew: [
new StreamReporter(fs.createWriteStream('./events.ndjson'))
],
});
// protractor.conf.js
const { StreamReporter } = require('@serenity-js/core');
exports.config = {
framework: 'custom',
frameworkPath: require.resolve('@serenity-js/protractor/adapter'),
serenity: {
crew: [
new StreamReporter(process.stdout),
],
// other Serenity/JS config
},
// other Protractor config
};
Constructor Summary
Public Constructor | ||
public |
constructor(output: Writable, stage: Stage) |
Method Summary
Public Methods | ||
public |
assignedTo(stage: Stage): StageCrewMember Creates a new instance of this StageCrewMember and assigns it to a given Stage. |
|
public |
notifyOf(event: DomainEvent): void Handles DomainEvent objects emitted by the StageManager. |
Public Constructors
public constructor(output: Writable, stage: Stage) source
Params:
Name | Type | Attribute | Description |
output | Writable | A Writable stream that should receive the output |
|
stage | Stage |
|
The stage this StageCrewMember should be assigned to |
Public Methods
public assignedTo(stage: Stage): StageCrewMember source
Creates a new instance of this StageCrewMember and assigns it to a given Stage.
Params:
Name | Type | Attribute | Description |
stage | Stage | An instance of a Stage this StageCrewMember will be assigned to |
See:
public notifyOf(event: DomainEvent): void source
Handles DomainEvent objects emitted by the StageManager.
Params:
Name | Type | Attribute | Description |
event | DomainEvent |
Returns:
void |