Behavior wrt white space in marble diagrams not conforming to rxjs's documentation
See original GitHub issuerxjs
’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
(withcross-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:
- Created 5 years ago
- Comments:8 (8 by maintainers)
Top GitHub Comments
I’ve just published 4.0.0, which defaults to using the new
run
behaviour. The old behaviour is accessible via theconfigure
function - which has changed. See the CHANGELOG for details.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.