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.

Make error message more descriptive

See original GitHub issue

Sometimes error messages for hash comparison looks like that

expect(data.pagination).to.eql
  currentPage      : 2
  perPage          : 3
  pagesCount       : 3
  currentPagePath  : '/tag/News?page=2'
  firstPagePath    : '/tag/News'
  previousPagePath : '/tag/News'
  nextPagePath     : '/tag/News?page=3'
  lastPagePath     : '/tag/News?page=3'
expected { Object (currentPage, perPage, ...) } to deeply equal { Object (currentPage, perPage, ...) }

looking at such message it’s hard to understand what’s wrong there.

Maybe add more details?

Issue Analytics

  • State:closed
  • Created 11 years ago
  • Comments:20 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
paulyoungcommented, Jun 11, 2014

Based on this StackOverflow answer, I believe the issue was occuring for me because my tests were asynchronous.

I got diffs working correctly again by using the following pattern:

try {
    expect(true).to.equal(false);
    done();  // success: call done with no parameter to indicate that it() is done()
} catch(e) {
    done(e);  // failure: call done with an error Object to indicate that it() failed
}
0reactions
export-mikecommented, May 18, 2016

@paulyoung yes same thing for me, “DONT forget to return that PROMISE!”

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Write Good Error Messages - UX Planet
Be concise and write a short description that is meaningful for user and gives him a clear idea of the problem and how...
Read more >
Descriptive Error Messages - DevIQ
When something unexpected or exceptional happens in a software application, usually an error message is displayed to the user and/or logged somewhere for...
Read more >
Best 10 Examples And Guidelines For Error Messages
Here are ten basic guidelines to help you create the most effective error messaging for your users. Click here to see all of...
Read more >
Error Messages: Examples, Best Practices & Common Mistakes
Useful error messages can keep users on your site and increase conversions. See examples and learn the best practices.
Read more >
How to Write & Design User-Friendly Error Messages
1. Clarity is key ... When it comes to writing error messages, clarity is your top priority. You need to describe what happened,...
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