question-mark
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.

Support for spaces in marbles strings

See original GitHub issue

The following example can be read in Anatomy of a Test:

var e1 = hot('----a--^--b-------c--|');
var e2 = hot(  '---d-^--e---------f-----|');
var expected =      '---(be)----c-f-----|';

expectObservable(e1.merge(e2)).toBe(expected);

However, this kind of formatting is not auto-formatter friendly, and I would not follow incompatible practices. And if I recall, the Clean Code book by Robert C. Martin also advises against columned alignment.

What would work however if you let those marbles strings contain spaces. Having to trim manually is an overhead however that I would not do myself, to keep things easily readable.

Edit: I know that we already started using columned alignment in the strings. But by exceeding the boundaries of strings for columned alignment, we make this problem even worse. So all I’m saying is that we keep this special formatting inside the strings where no auto-formatter cares what we do in it.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
cartantcommented, Jan 19, 2020

Closing this because spaces have no meaning when the TestScheduler is used in run mode.

0reactions
cartantcommented, Jan 19, 2020

Note that it’s only ignored when the run method is used. The run method was introduced after this issue was opened and its behaviour is very different from that of the original TestScheduler implementation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Marble strings should ignore whitespace · Issue #81 · just-jeb/jest ...
The readme seems to suggest to align marbles using spaces, outside of the marble string: ... feat: support aligning marble strings using leading...
Read more >
Testing RxJS Code with Marble Diagrams
' ' whitespace: horizontal whitespace is ignored, and can be used to help vertically align multiple marble diagrams.
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. - A...
Read more >
5 Options for Anchoring Your Cello's Endpin | Strings Magazine
Cellists should always have rock-stop options on hand. Here are a few basic types of endpin holders, each with its pros and cons....
Read more >
Marble Framework Home - WikiLeaks
Special characters are supported \r, \n, etc. However, when using \x in strings you must supply 4 characters in a WARBLEObfuscation Function (see...
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found