New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(client): handle lessons with syntax errors #54694
base: main
Are you sure you want to change the base?
feat(client): handle lessons with syntax errors #54694
Conversation
There's nothing gained by partially applying a function only to immediately call the new function with the missing argument. Similarly, using attempt to return an error and then throwing that error achieves nothing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR's good to go from mobile perspective. Not sure why it got removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this locally and it is working well on my end.
This will be a huge help to campers and for us to teach syntax lessons in the debugging projects.
But how do we want to handle this open issue
#52749
We could just close it, since this PR does resolve that issue of the tests not running.
But I am also wondering if it would be good to add an additional generalized message to the console to let them know that they have syntax errors. That was brought up in that issue thread.
Maybe something like this
Your code has syntax errors. Double check that you are not missing any commas `,` or curly braces `{`.
thoughts?
It's a bit tricky to make the console output clear. As of this PR the console will show the syntax error until the learner runs the tests. At that point it will show test output and any errors raised during the testing. Putting the syntax error into the console as well as all that would make it quite busy and confusing. How about adding a message to the lower jaw if there's a syntax error and they haven't run the tests? |
I like that solution 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
How about adding a message to the lower jaw if there's a syntax error and they haven't run the tests?
This could be optional. Nice but non blocking in my opinion 👍
Checklist:
main
branch of freeCodeCamp.Syntax errors in learner code should still generate an error in the console, but now it should be possible to run tests against the code irrespective of whether or not it's syntactically valid.
To test this, the easiest thing to do is to modify a lesson so that it just tests
code
and then go that lesson, create a syntax error and run the tests.Closes: #49018