| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
Welcome @alejandronanez and thanks for the pull request. I imagine the idea here was to replace the try/catch. This change as it stands merely complicates the test. If you're at Code & Learn and you're not sure how to proceed, ask a mentor for some help! Thanks!
Sorry, something went wrong.
|
Hey @Trott thanks for chiming in! Actually this change was made based on the feedback from @ErickWendel at the Code & Learn session, fwiw, this was the suggested solution for this change:
How should I proceed from here then? Thanks again :)! |
Sorry, something went wrong.
Replace the entire try/catch block with an equivalent assert.throws() call. It is not a case of replacing assert.ok() with assert.throws(). |
Sorry, something went wrong.
|
haha @alejandronanez sorry, I told you to put the assert.throws but I forgot to tell you to remove the entire try/catch. It was busy with many questions during the session. If you wanna some help, feel free to reach me :D |
Sorry, something went wrong.
|
As this change currently stands, it does not merely complicate the test. It also invalidates it! The test will always pass. The error is no longer checked, other than to confirm that throw err throws err. It's easy to see how the change can be improved on and be totally acceptable, but right now, it complicates the code and invalidates the test. |
Sorry, something went wrong.
|
Hello @Trott, I made some updates to the test. Let me know what you think, thanks! |
Sorry, something went wrong.
We're getting close! |
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM with the comment addressed.
Sorry, something went wrong.
|
wow I completely missed this conversation! I already fixed the lint errors in edac77982b56b5a358361048ad6166e7f2f1c725. Thanks y'all for your feedback |
Sorry, something went wrong.
Use assert.throws() instead of try/catch.
|
Rebased against master, added the regexp back so we're still checking that the message correctly reports the path of the file that caused the problem, and force-pushed. @jasnell @trivikr @addaleax @BridgeAR PTAL to confirm that this is still to your liking. Thanks! |
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Use assert.throws() instead of try/catch. PR-URL: nodejs#28358 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
|
Landed in c3b2111. Thanks for the contribution! 🎉 (If you're interested in other possible contributions to Node.js but don't have a good idea of where to start looking, some ideas are posted at https://www.nodetodo.org/next-steps/.) |
Sorry, something went wrong.
Use assert.throws() instead of try/catch. PR-URL: #28358 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
| Back | FazBrowse Home | New Git URL |
Used assert.throws instead of assert.ok in test/parallel/test-require-json.
Checklist