Ad
  • Custom User Avatar

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

  • Custom User Avatar

    Arrays are Objects ( almost everything is an object ).

    I suppose by

    string, boolean, number or object

    you mean it cannot be an array.

    I would make this explicit.

    In JavaScript, arrays function more or less as objects with numerical properties ([ "zero", "one" ] ~ { 0: "zero", 1: "one" }), so it would not even make it harder for the user to allow arrays as well. But you don't have to.

  • Custom User Avatar

    Thank you.

    I slightly extended the messages to make debugging easier for people. (Test.assertEquals and friends generate these messages automatically, BTW.) In the example tests the messages aren't really necessary, because you can see what's being tested. So leaving them out there is not really a problem.

    I also fixed some spelling erorrs in tests and description.

  • Custom User Avatar

    Thanks. Added my own messages

  • Custom User Avatar

    From the documentation:

    Test.expect(passed, msg)

    Core assertion method that all other methods build off of. msg argument is optional. If it is not provided then a generic message will be used. Best practice is to provide your own message.

    (my emphasis)

    Please follow this best practice.

  • Custom User Avatar

    null is an Object. Expected results should be specified, and it should be tested with.

  • Custom User Avatar

    Sorry, i'm not sure I understand what you mean by "random tests" , I'm pretty new in here :)

  • Custom User Avatar

    Well, as they are example tests , they don't cover everything.
    Do you think I should add nested tests as well?
    I do have them in the actual test cases

  • Custom User Avatar

    Thanks, fixed it.

  • Custom User Avatar

    Also, where are the random tests?

  • Custom User Avatar

    Example tests does not test about the "nested compare" part.

    Also, can you at least show what are the two objects, and the expected answer?

  • Custom User Avatar

    You should add an empty function in the initial solution (replace var websites = [] with function isPartiallyEqual() {}). That's the part that the user sees when he takes the kata. Some random testing or test shuffling should be added too.