Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Even better would be to put the string in an array and print that array:
That way you are shown things like
\r\n\t
without ambiguityWelp. Okay. I wasn't going to submit with your code because... well it's your code, and I haven't solved it yet >.>
I ran it anyhow. I see it now.
How do I phrase this .. Yes, this is confusing test output. Though, they're correctly judging your result. The output is off because ... because codewars uses imperfect encoding of data between the tests, the servers and our browsers and because of that there can be ambiguities or mixups. You are logging, it isn't shown.
Replace
console.log(string)
withconsole.log("Input value: '" + string + "'")
There is nothing wrong with the tests.
BTW. Next time you ask about something odd, make sure that you are up-fronting enough information to reproduce what you're seeing. Otherwise you are the host of a guessing game, and you probably aren't getting any answers that you want as a result of not having provided enough information to produce those answers.
For example, you showed your solution code... which is good, but not sufficient. Pressing reset and entering your code, followed by running the sample tests does not produce the output you're describing. So effectively it isn't happening and you can't really ask about something that isn't happening.
Of course, we could trust you on what you're saying, but that doesn't ... really work at all. First of all, why would we? You might know yourself to be trustworthy, nobody else does. And then there's going to be information lost in communication, and furthermore you're probably not making the required observations or you'd have figured it all out. But when you show how to reproduce it, you get rid of all those very difficult problems.
The original sample tests have four assertions, you show five. That makes the fifth assertion likely to be something you added. And presumably the reason why there is no log is because nothing was logged.
Those are separate tests. Note that you get one verdict per assertion.
Your code is failing the next test.