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

Differences are vanished in error output message #95

Open
bence-balogh-intland opened this issue May 12, 2023 · 2 comments
Open

Differences are vanished in error output message #95

bence-balogh-intland opened this issue May 12, 2023 · 2 comments

Comments

@bence-balogh-intland
Copy link

bence-balogh-intland commented May 12, 2023

Hi guys,
Please consider the following test case:

    it.only('should whatever', () => {
        const result$ = cold('-a--|', {
            a: { prop: NaN }
        });

        const expectedResult$ = cold('-a--|', {
            a: { prop: null }
        });

        expect(result$).toBeObservable(expectedResult$);
    });

The 2 prop obviously differs, so the test case will fail.
Unfortunately, the difference is vanished from the output message, since during stringification of frames, NaN becomes null:
image

The differences should be highlighted as follows:
image

Could you please check?

Thanks,
Bence

@bence-balogh-intland
Copy link
Author

Probably same issue as in:
#88

@NiklasPor
Copy link

One of the few reasons jest-marbles may be used over jasmine-marbles is that due to the output of jasmine-marbles it's nearly impossible to compare complex observables.

Here a simple comparison:

jasmine-marbles (running with jest) ⬇️

jasmine marble output

jest-marbles (also running with jest) ⬇️

jest marble output

As you can see, it's way easier to detect what went wrong inside the test-case with the better formatted print, highlighting and fifing

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