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.

Test Error Message does not indicate wrong string

See original GitHub issue

Describe your problem and how to reproduce it:

The test error messages do not indicate anything about resolve and reject’s strings.

reject should be executed when the if condition is false.
// tests completed

This may throw some people off as the message error just indicates the if statement did not fire.

Add a Link to the page with the problem:

https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/es6/complete-a-promise-with-resolve-and-reject

Test Code:

const makeServerRequest = new Promise((resolve, reject) => {
  // responseFromServer represents a response from a server
  let responseFromServer;

  if(responseFromServer) {
    resolve("We String");
  } else {	
    reject("Data String");
  }
});

Tell us about your browser and operating system:

  • Browser Name: Chrome

  • Browser Version: 81.0.4044.124

  • Operating System: iOS 81.0.4044.124

If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box):

BBCE96E4-F281-4C08-9739-F11FCF7C0038 E1BF97DA-2F1F-4B12-8AD0-4DFBEB712881

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
raisedadeadcommented, May 13, 2020

Also we have some documentation here: https://contribute.freecodecamp.org if you want to learn more.

0reactions
MrKevinOConnellcommented, May 13, 2020

I’m working on setting up my repo locally and getting a basic idea of the codebase, as I’ve never worked with YAML; if anyone else wants to fix this issue don’t hesitate! I can work on something else.

Like I said I’m new to open source so all of this stuff is new to me, apologies for me taking this long, I will be a lot more productive once I have more time on my hands.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to unit test Go errors - Stack Overflow
In most cases you can just check if the error is not nil. I'd recommend not checking error strings unless absolutely necessary.
Read more >
CS 111: Common Java Errors - CS-People by full name
This error occurs when the class name and the filename of a given Java program do not match. For example, say that the...
Read more >
Write error messages for your UI with validate - R Shiny
If the object is an empty string, the test returns the message: “Please select a data set.” Modify your script and relaunch the...
Read more >
A Definitive Guide to Handling Errors in JavaScript - Kinsta
Check Out Our Video Guide to Handling JavaScript Errors ... The error message will usually indicate what is wrong with your code.
Read more >
How to Report Errors in Forms: 10 Design Guidelines
But even when the fields are not validated inline, it pays off to show an actionable error message below or next to the...
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