Ad
  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Ahh I see. Awesome, thanks for your help!

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    haha! Thanks Chrono, you beat me to posting it!!

  • Default User Avatar

    Actually, think this is the problem (solution from user Mosef):

    For anyone having an issue because the tests/ final submission look like:
    
    There are 17 sheeps in total, not There are 17 sheeps in total
    
    There are 500 sheeps in total, not There are 500 sheeps in total
    
    There are no sheeps at all, you counted There are no sheeps at all
    
    Don't return a string with your answer. Though it seems that's what the sample tests want you to output, the final tests don't.
    

    With follow-up explanation from user Chrono79 :

    Test.expect(Boolean value, String error message)
    
    That's how Test.expect works
    
    countSheeps(array1) == 17
    
    Your function should return 17, not a string.
    
    Test.expect isn't encouraged to use, it's better to use Test.asserEquals because the latter shows both the actual and expected values in the error     message.
    
  • Default User Avatar

    I'm having the exact same problem (Javascript). I've read the troubleshooting section on codewars GitHub, specifically the "When I print my answer it looks exactly the same as the expected value given by assertion message, yet some/all tests fail. Why?" section, but still not come up with an answer to why my code isn't working. I'll print my code below