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.

Show multiple expect failures

See original GitHub issue

Jasmine provides multiple expect failures to the report, however, the report is currently only showing the first failure. This isn’t really helpful since we want to see all of our expect failures, right? That’s why we put them there.

I was able to find where the issue is, in index.js:

Here it is only grabbing the first in the failedExpectations array.

metaData.message = (results.failedExpectations[0] || {}).message || 'Failed';

Instead, something like the below can be implemented (you can do the same with .stack):

if (results.failedExpectations[0].message) {
    metaData.message = results.failedExpectations.map(result => result.message);
} else {
    metaData.message = 'Failed';
}

This might not be the cleanest way, I’m still pretty new to JavaScript, but I figured this would at least be a good starting point for whoever would work on this. I can also work on this and create a PR, however, it might take me a bit to learn how it works, make sure it works, get time, etc. So, I figured I put this here incase someone can get to it much faster.

Thanks for your time!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
miller45commented, Aug 21, 2018

In the meantime you could use it directly from git (if your team and your company firewall allows it) by using: "protractor-beautiful-reporter": "git+https://github.com/Evilweed/protractor-beautiful-reporter.git", in your the devDependencies section of your package.json

0reactions
miller45commented, Sep 24, 2018

@Brian-Dawson-Nerdery did not notice that Evilweed did the npm release on 25 August already… so closing this now

Fix was released on 25. Aug. 2018 on v1.2.5.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I expect multiple failures in google test?
The problem is that the failures are intended, the test case verifies that they actually do fail (in case of asserts detect the...
Read more >
How to View Multiple JUnit Assertion Errors in One Test ...
Learn an easy solution to view all of the JUnit Assertion errors in one test execution from the test automation professionals at tapQA!...
Read more >
Expected Failures | Apple Developer Documentation
An image showing two unit tests. The first test demonstrates how Xcode highlights an assertion. If no assertion failures occur, Xcode marks the...
Read more >
Stop requiring only one assertion per unit test
Assertion Roulette doesn't mean that multiple assertions are bad. ... Equal() Failure Expected: NotFound Actual: OK. There's no ambiguity.
Read more >
Delayed assert / multiple failures per test | pythontest
Several related variables all need to be tested. Showing all of the failing conditions can help diagnose what the problem is. The setup...
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