Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toEmitValue matchers #526

Open
MillerSvt opened this issue Jul 5, 2024 · 2 comments
Open

toEmitValue matchers #526

MillerSvt opened this issue Jul 5, 2024 · 2 comments

Comments

@MillerSvt
Copy link
Contributor

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
Copy link
Contributor Author

@just-jeb what do you think about it? I can do this...

@just-jeb
Copy link
Owner

@MillerSvt I'm not quite sure about how common this scenario is, but given that pretty much all the matchers are nothing but a syntactic sugar I don't have a strong opinion on this.
So if you want to go ahead and make a PR I won't object.

MillerSvt added a commit to MillerSvt/jest-marbles that referenced this issue Jul 18, 2024
MillerSvt added a commit to MillerSvt/jest-marbles that referenced this issue Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants