[learn] tests should fail when code has error
See original GitHub issueI entered a valid solution and passed all the tests in the picture below. Then I added the a
on the second line: var collection = { a
- to make the build fail, but all the test results still have the green check mark like they passed. I think they should go back to failed if there’s an error.
Issue Analytics
- State:
- Created 4 years ago
- Comments:18 (18 by maintainers)
Top Results From Across the Web
Cause tests to fail when error is thrown after test has completed
I'm trying to find a way to make sure none of my jest tests are throwing errors from an async function. For instance...
Read more >The Difference Between Failure and Error in JUnit | Baeldung
In short, failures are unfulfilled assertions while errors are due to abnormal test execution. 2. Sample Code. Let's consider a very simplistic ...
Read more >Testing a trigger that is suppose to cover an failed check
Reaching that deliberately failing assertion means in this case that the error text wasn't added to the record because of the missing gender....
Read more >Django Tutorial Part 10: Testing a Django web application
Because they are fast, automated tests can be executed more regularly, and if a test fails, they point to exactly where code is...
Read more >Testing Best Practices - LearnHowToProgram.com
The tests we write always need to be a source of truth. We always need to write a test so that it passes....
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
@Stevo99 As Mrugesh said on Gitter, the codebase is a bit complex. The bit responsible for updating the test results is https://github.com/freeCodeCamp/freeCodeCamp/blob/1c669fd56838b68710062bc09f6e4af34e7cf709/client/src/templates/Challenges/redux/execute-challenge-saga.js#L56-L61 and you can see that if there’s an error (which is the case we’re looking at) only the console gets updated, not the tests.
One approach would be to look at the code in https://github.com/freeCodeCamp/freeCodeCamp/blob/1c669fd56838b68710062bc09f6e4af34e7cf709/client/src/templates/Challenges/redux/execute-challenge-saga.js#L82 for inspiration and try to figure out a way to update the tests so they all show as failing.
@ValeraS So a few of the Team Members said that your suggestion is the best way to fix this issue. I’m not that experienced with this codebase and I was just wondering if maybe you can explain how I can go about setting an initial state for the tests. I tried to figure it out myself but could not unfortunately. Any help would be appreciated. Thanks!!