Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Behavior wrt white space in marble diagrams not conforming to rxjs's documentation

See original GitHub issue

rxjs’s documentation on marble syntax says that

' ' whitespace: horizontal whitespace is ignored, and can be used to help vertically align multiple marble diagrams.

These are the unit tests inside RxJS itself that show in details how white spaces should be treated (tests named “should ignore whitespace when runMode=true”).

However, it looks like the wayrxjs-marbles parses white spaces in marble diagrams doesn’t obey that rule.

I made a fork with a few small changes to demonstrate the problem. On the whitespace-bug-demo branch, I first created a test for white space behavior without actually using those whitespace (commit 6828f98) . The tests for jest pass at this point. The test command I used is the same the one you used to test jest:

  • yarn run test:build
  • cross-env FAILING=0 yarn run test:jest (with cross-env scoped to the package’s directory, not globally).

Then I add white spaces into a marble diagram (commit 1a36cc4). The white space test failed, indicating that the added white spaces changed how the marble diagrams are parsed when they really shouldn’t. This is the diff between those two commits for your convenience.

Am I misunderstanding the rxjs’s marble syntax explanation or is there a bug in your library?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

cartantcommented, May 17, 2018

I’ve just published 4.0.0, which defaults to using the new run behaviour. The old behaviour is accessible via the configure function - which has changed. See the CHANGELOG for details.

cartantcommented, May 16, 2018

It’s not super hard; I just want to do it in a flexible manner. Using the old behaviour should be an option whilst it’s deprecated and v6 only just came out, so it needs to be supported for a while, yet.

I’ll have a think about it and there should be a new release in the next week or so. It’ll likely be a major version bump - as it’ll be a breaking change - with the behaviour changing to default to using run and an option to not use it - i.e. to stick with the old behaviour.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Testing RxJS Code with Marble Diagrams
' ' whitespace: horizontal whitespace is ignored, and can be used to help vertically align multiple marble diagrams. '-' frame: 1 "frame" of...
Read more >
How to Read an RxJS Marble Diagram | by Zach Gollwitzer
To an experienced RxJS user, marble diagrams are helpful. To someone just starting out with RxJS, they look like a little kid's drawing...
Read more >
RxJS - Marble Testing - DEV Community ‍ ‍
whitespace: horizontal whitespace is ignored, and can be used to help vertically align multiple marble diagrams.
Read more >
Marble diagram for delay() is incorrect in documentation #6741
I'm preparing some RxJS guide for Angular devs and I've noticed that the marble diagram image for delay() is wrong.
Read more >
Marble Syntax | Testing - RxJS Course
Let's start with a few of the basics of the marble string syntax and what each character(s) represent: Whitespace is ignored.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found