freeCodeCamp icon indicating copy to clipboard operation
freeCodeCamp copied to clipboard

feat(client): show error, warn, and info in FCC debug console

Open a2937 opened this issue 2 years ago • 5 comments

Checklist:

Closes #48744

a2937 avatar Feb 26 '23 18:02 a2937

:eyes: Review this PR in a CodeSee Review Map

View the CodeSee Map of this change

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

ghost avatar Feb 26 '23 18:02 ghost

@a2937 Would you provide some instructions on how to test your fixes.

bbsmooth avatar Feb 27 '23 02:02 bbsmooth

@a2937 Would you provide some instructions on how to test your fixes.

Manual testing:

Step One: Start up the local FreeCodeCamp client and server with MongoDB database running in the background, Step Two: Navigate to the client on port 8000 in your preferred web browser. Step Three: Open up the curriculum Step Four: Navigate JavaScript Algorithms and Data Structures
Step Five: Open a random challenge Step Six: Find the text box to type the code in Step Seven: In the text box type console.log("Hello"); to have something to compare it to. Notice in the output it says "Hello" Step Eight: Type console.info("Hello"); into the text box. Notice it should say "Hello" in the output as well. Step Nine: Type console.warn("Warning"); into the text box. Notice it should say "Warning" in the output. Step Ten: Type console.error("Error"); into the text box. Notice it should say "Error" in the output.

As for automated testing, I would be happy to provide some. However I had difficulty finding existing unit tests for the proxy logger.

a2937 avatar Feb 27 '23 03:02 a2937

As for automated testing, I would be happy to provide some. However I had difficulty finding existing unit tests for the proxy logger.

I don't think it's needed, there are no steps that requires using them, and when there will be one, the step itself will act as the unit test

Sboonny avatar Feb 27 '23 07:02 Sboonny

Understandable.

a2937 avatar Feb 27 '23 15:02 a2937

image

I wish we could DRY this out a bit, but it works as is!

I could create a new method in test-evaluator called "pushLogs" that would take care of the biggest offender.

a2937 avatar Feb 28 '23 00:02 a2937