Spinal Tap Case - bug in test?

Tell us what’s happening:

Hi, my code pass all tests except third ( spinalCase("The_Andy_Griffith_Show") ) but somehow in output i see diffrent test: spinalCase("The_Andy_<wbr>Griffith_Show") should return "the-andy-griffith-show".

So it is bug? Or i need to make function and for that case ( "The_Andy_<wbr>Griffith_Show") ?

Your code so far

function spinalCase(str) {
  // "It's such a fine line between stupid, and clever."
  // --David St. Hubbins
  return str.split(/(?=[A-Z_])|\W/).join("-").toLowerCase();
}

spinalCase("The_Andy_Griffith_Show");

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/spinal-tap-case

1 Like

Looks like your output on my computer is

the-_-andy-_-griffith-_-show instead of the-andy-griffith-show

So you will need to fix your regex.

that <wbr> has been popping up in a few different test sets. Saw two questions about it last night. If ever you see that in the expected output, assume that it ain’t supposed to be there.

Yeah, it’s a bug, got introduced recently I think. If you feel so inclined, stretch your github skills and file a bug report about it! :slight_smile:

I will keep digging, I could have sworn it was a post I’d commented on yesterday, but now my eyeballs hurt from looking through my history. It was a simple string output thing, and the failure message in the console included the <wbr>. If I find it (or any others) I’ll pm them to you.

Thank you. I was worried I’d lost my mind. precog nightmares and stuff. :wink:

U were right. Thanks