jest-marbles icon indicating copy to clipboard operation
jest-marbles copied to clipboard

toEmitValue matchers

Open MillerSvt opened this issue 7 months ago • 2 comments

I suggest adding a few matchers for a narrower stream check.

const expected = cold('a', {a: value});
expect(stream).toBeObservable(value);

// replaces with

expect(stream).toEmitValueFirst(value);
const expected = cold('--a', {a: value});
expect(stream).toBeObservable(value);

// replaces with

expect(stream).toEmitValueNth(value, 3);
// there are no alternatives

expect(stream).toEmitValueLast(value);

MillerSvt avatar Jul 05 '24 06:07 MillerSvt