freeCodeCamp icon indicating copy to clipboard operation
freeCodeCamp copied to clipboard

Trivia Bot - Allow separate space concatenation or update requirements

Open lasjorg opened this issue 7 months ago • 2 comments

Describe the Issue

The tests expect spaces in the sentence to be part of the text, not separately concatenated spaces. The requirements should say so, or the test should allow the format:

console.log("My favorite programming language is" + " " + favoriteLanguage + ".");

I think it is only an issue with the strings directly logged and not the assigned strings.

https://github.com/freeCodeCamp/freeCodeCamp/blob/9267a8b3a1be34fa2e03b4765eb74ec9d30c0115/curriculum/challenges/english/25-front-end-development/lab-javascript-trivia-bot/66ed41f912d0bb1dc62da5dd.md?plain=1#L70-L84

Affected Page

https://www.freecodecamp.org/learn/full-stack-developer/lab-javascript-trivia-bot/lab-javascript-trivia-bot

Your code




Expected behavior

Allow spaces to be concatenated to the string in the console.log tests, or update requirements.

Screenshots

No response

System

  • Device: [e.g. iPhone 6, Laptop]
  • OS: [e.g. iOS 14, Windows 10, Ubuntu 20.04]
  • Browser: [e.g. Chrome, Safari]
  • Version: [e.g. 22]

Additional context

Forum: https://forum.freecodecamp.org/t/build-a-javascript-trivia-bot-build-a-javascript-trivia-bot/747822

lasjorg avatar May 19 '25 19:05 lasjorg

I'm in favor of checking the console directly and removing the spaces requirement. As long as the output matches the right content, it's fine in my opinion.

a2937 avatar May 19 '25 19:05 a2937

We are going to need to wait for --before-all-- to be accessible in this type of challenges, unless @ojeytonwilliams already finished that

edit: ah well, --before-user-code-- is already used here, so that can stay for now, once --before-all-- is availabel we will change that in a different issue/pr

majestic-owl448 avatar May 22 '25 06:05 majestic-owl448