Test Error Message does not indicate wrong string
See original GitHub issueDescribe 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:
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):
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Also we have some documentation here: https://contribute.freecodecamp.org if you want to learn more.
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.