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.
This comment is hidden because it contains spoiler information about the solution
Array
s areObject
s ( almost everything is an object ).I suppose by
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.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.
Thanks. Added my own messages
From the documentation:
(my emphasis)
Please follow this best practice.
null
is anObject
. Expected results should be specified, and it should be tested with.Sorry, i'm not sure I understand what you mean by "random tests" , I'm pretty new in here :)
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
Thanks, fixed it.
Also, where are the random tests?
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?
You should add an empty function in the initial solution (replace
var websites = []
withfunction isPartiallyEqual() {}
). That's the part that the user sees when he takes the kata. Some random testing or test shuffling should be added too.