Skip to content
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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ojeytonwilliams
Copy link
Contributor

@ojeytonwilliams ojeytonwilliams commented May 7, 2024

Checklist:

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

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.
@github-actions github-actions bot added the platform: learn UI side of the client application that needs familiarity with React, Gatsby etc. label May 7, 2024
@ojeytonwilliams ojeytonwilliams marked this pull request as ready for review May 7, 2024 16:42
@ojeytonwilliams ojeytonwilliams requested review from a team as code owners May 7, 2024 16:42
Copy link
Member

@Nirajn2311 Nirajn2311 left a 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.

@Nirajn2311 Nirajn2311 requested a review from a team May 7, 2024 19:38
Copy link
Contributor

@jdwilkin4 jdwilkin4 left a 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?

@ojeytonwilliams
Copy link
Contributor Author

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?

image

@jdwilkin4
Copy link
Contributor

I like that solution 👍

Copy link
Contributor

@jdwilkin4 jdwilkin4 left a 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 👍

@jdwilkin4 jdwilkin4 added the status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending. label May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: learn UI side of the client application that needs familiarity with React, Gatsby etc. status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HTML challenges do not warn users or run tests when there are syntax errors
3 participants