new StreamState()
Caller-visible stream state for comparison.
Guarantees/Invariants:
- Equivalent states are assert.deepStrictEqual.
- States can be round-tripped to JSON at any point.
- States are owned by the caller, so any additional properties (which are permitted to violate the above guarantees) are preserved and the same state object is always returned.
As a result, objects of this class have no methods and do not contain any non-state information (e.g. the stream itself or the comparison options) and their prototype is never used.
Members
data :Array|Buffer|string
Data returned/emitted by the stream (as an
Array
if in
objectMode
).
Type:
- Array | Buffer | string
ended
Has the stream emitted
'end'
or 'error'
.
(non-null) events :Array.<!{name: string, args: !Array}>
Events emitted by the stream.
Type:
- Array.<!{name: string, args: !Array}>
expectEvents
Are more events expected on this stream?
Initially true, currently set false once an event in options.endEvents has
been emitted and no additional events have been emitted since the event
queue was last cleared (i.e. after setImmediate).
totalDataLen
Count of total objects read in
objectMode
, bytes/chars read
otherwise.