Freecodecamp: Default Output for Output Component is Misleading

Created on 22 May 2017  路  13Comments  路  Source: freeCodeCamp/freeCodeCamp

cc/ @freeCodeCamp/moderators This issue is that the Output component says that all outputs and console.log() statements will output to this mock "console", however, in most cases, this is actually not the case.

Right now, the component really only serves as an indicator of whether or not the tests have passed and/or if the test suite is running. Occasionally console.log outputs will show up here if the correct code is in the editor when the page loads. But I don't see challenge outputs here in any case.

Take this for example. A very simple challenge, with no output and no console.log() statement being shown (you will see the console.log() when you follow the link, but not when you run the challenge - the console.log() output would never be seen in the typical FCC "workflow"). Instead, all you get is:

// running tests
// tests completed

Or if the answer is wrong, a series of error messages.

However, I also tend to think that the error messages going here is redundant because the test case indicators themselves clearly indicate what is passing and what is failing. I think it would be more useful to have console.log()statements and return values be shown here instead.

If no one else agrees, I think at the least, we should change the default text so that campers are not misled as to what will be shown in the "console". e.g. something besides this since neither really seems to be true:

/**
  * Your output will go here.
  * Any console.log() statements
  * will appear in here as well.
*/
help wanted bug

All 13 comments

/cc @BerkeleyTrue Can you guide what needs to be implemented for this, to function correctly?

But I don't see challenge outputs here in any case.

you will see the console.log() when you follow the link, but not when you run the challenge

There is an issue to change the implicit output of challenges to explicitly use console logs. This change was made during the refactor of the rechallenge framework. Expecting the output of challenges to be outputed automatically by the framework made it impossible to add async testing. Once those challenges have been refactored to add a console log where ever those challenges have output, that will resolve that issue.

see: https://github.com/freeCodeCamp/freeCodeCamp/issues/9363

I also tend to think that the error messages going here is redundant

The output reports all uncaught errors not just the test errors. This will catch errors unrelated to the tests such as incorrect syntax. If it is not doing this then it is an issue.

Oh right. I forgot about the other thread, thanks for the confirmation!

@BerkeleyFalse @raisedadead I do remember that other issue about the wrapping the function calls in console.log() to get the output, but I've tested that in a few places, and still don't see the output in the output box (again, unless the correct code is loaded from a past solution when the page loads, once you run it - no output). Example.

Also, in regards to uncaught errors - I'm not sure I'm seeing this functionality - any serious syntax errors prevents the code from running altogether and you end up with the flash message at the bottom right "Something went wrong..."

Lastly, if there are uncaught errors, or incorrect test cases, will the errors completely replace the output of console.log() statements within the code itself and/or the output of final function statement? Error messages are helpful, but being able to see what your code outputs or to log something mid-way through a transformation is more helpful if you are stuck on something.

Personally, I'm partial to the idea that all campers should be using the browser's console anyway, but this won't be the case with many new users who haven't quite figured out how much better it is yet.

鈽濓笍 Ughh, I just realized I got tricked and mentioned BerkeleyFalse not @BerkeleyTrue in the above post.

I can confirm the issue described by @no-stack-dub-sack. I can't get console.log statements to show up under any circumstance in the linked challenge, as well as the uncaught errors showing "Something went wrong..."

@systimotic just curious, have you tested this since the big changes?

Also, from what I could tell, this was across all challenges, not just the linked one.

@no-stack-dub-sack @BerkeleyTrue I just did, still doesn't work 馃槥

Again, this is not about challenges not including a console.log() by default, this is about any console.log(), pre-existing or manually written, not showing anything in the output panel.

@systimotic Yup, that's the same thing I've experienced. But I don't know if issues like this are just getting pushed to the backburner for now while other major changes get implemented, or??

Maybe at the very least, we can comment out that message for the time being so that we don't give the wrong impression? I'm not sure, I know there's a ton else to do before this thing is ready to move to prod, and issues are loosely collected all over the place. Not sure what the best approach is at this point...

@systimotic Maybe we can remove blocked and add confirmed back to the labels to make it clear this is a confirmed issue, since there seemed to be some misunderstanding when this was first re-labeled?

I'm closing this issue as stale since it hasn't been active lately. If you think this is still relevant to the newly updated platform, please explain why, then reopen it.

Wait, has this been resolved? I notice using freecodecamp that log.console does not output to the bottom right pane... where it says

"/**

  • Your test output will go here.
    */

It instead only shows errors... You cannot do any testing, and there is no way to use
console.log() to get anything to show up there. Is that intended?

@Jeffreyoboe1 Yes, this is related to https://github.com/freeCodeCamp/freeCodeCamp/issues/17356

Please take a look at that issue. It has a temporary workaround while we fix it.

Was this page helpful?
0 / 5 - 0 ratings