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.
The use of
Test.expect
here is fine: it's just checking if the return value is truthy. Checking of actual values are done viaTest.assertDeepEquals
.Test block
Should return a non-empty map of player names to the sum of their winnings (or losses)
has no test assertions:Test.expect
is missing.The title should be in english
Test.expect
should be removedNode 12 should be enabled
assertSimilar
should be replaced withassertDeepEquals
in the sample tests.There're
undefined
's in the random inputs.Hi guys, I've added random test to my kata. Thanks for the advice
thanks for the advice. Very appreciate that
Success and failure messages from
assertDeepEquals
are a lot cleaner than those ofassertSimilar
.Also,
assertDeepEquals
ignores property order withinObject
s;assertSimilar
does not. Property order is sometimes undefined in JavaScript, so testing should not depend on it.assertEquals
is not going to work withObject
s; it compares references, not values.Hi Johan, Thanks for the recommendation. I was going to use assertEquals but did some reasearch about assertDeepEquals. It seems like a better choice.
Just wanted to ask you, from my understanding, assertDeepEquals check if the result is equivalent with expected output, even though they're not the same object. Is there any other reason why you suggested using assertDeepEquals?
Thank you
Yes
Needs random tests
Please do not use
assertSimilar
; useassertDeepEquals
instead.Paste your code and mark your post as having spoiler content.
Loading more items...