Ad
  • Custom User Avatar

    That's the message set in the tests when the test fails, not the expected output, see it here:
    Test.expect( goodVsEvil('1 1 1 1 1 1', '1 1 1 1 1 1 1') === 'Battle Result: Evil eradicates all trace of Good', 'Evil should win' );
    With Test.expect, the first argument is a comparison between the output of your function call and the expected output, the second part is the error message if the comparison returned false.

    Sometimes the kata creator uses describe, it and Test.assertEquals, that gives more info like:
    Expected: some value, instead got: some other value
    But that depends on how the kata is written.

  • Custom User Avatar

    Ok, great.

    But:
    https://imgur.com/uICuVQH - this is still hella confusing.
    Original sample tests are also wrong, according to the instructions.

  • Custom User Avatar

    The returned strings are wrong. This is copied from the instructions:

    Output:

    Return
    "Battle Result: Good triumphs over Evil" if good wins,
    "Battle Result: Evil eradicates all trace of Good" if evil wins, or
    "Battle Result: No victor on this battle field" if it ends in a tie.

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    Ok, so definitely doesn't work in JS - test cases are bonkers.