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

toEqual() not show expectationFailOutput in console log #1682

Closed
rebajz opened this issue Apr 15, 2019 · 2 comments
Closed

toEqual() not show expectationFailOutput in console log #1682

rebajz opened this issue Apr 15, 2019 · 2 comments

Comments

@rebajz
Copy link

rebajz commented Apr 15, 2019

fit('some text', async() => {
let components = element.all(by.xpath('//button'));

    await browser.get('http://localhost:3339/buttonpage');
    expect(await components.count()).toEqual((19), 'some text for fail ' + await components.count());
});

in console is visible only:

  • Expected 20 to equal 19.

for example toBe() show correctly fail message

@tymfear
Copy link

tymfear commented Apr 15, 2019

@rebajz you should use the withContext method:

await browser.get('http://localhost:3339/buttonpage');
expect(await components.count())
.withContext('some text for fail ' + await components.count())
.toEqual(19);

Failure output is not supported for toEqual method. Please see docs.

@slackersoft
Copy link
Member

In fact, none of Jasmine's matchers officially support the extra argument (expectationFailOutput in community types), but many of them happen to also print that out because of the laxness of how default failure messages are generated.

Closing this.

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

3 participants