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.
There's little real documentation. There's some, but it's fragmented and mostly outdated.
There really is no substitute for reading how other people do it. When you've solved a kata, you can look at its tests. Also, there's a lot of comments ( mostly on how not to do it ) on existing kata. Read those as well.
Couple of basics: use
Test.assertDeepEquals
andTest.assertApproxEquals
, and calculate expected values before actual values. ( Do not trust users not to modify their input. )I agree, and I'd love to know how to do this! Reading through the "Random Testing in JavaScript" Codewars snippet on GitHub (link below) leaves me wondering if there's a best practice for implementing the random arguments array generator. And really any advice on how to implement these random tests would be super helpful! Thanks for giving some attention to this Kata. :)
https://github.com/Codewars/codewars.com/wiki/Snippets%3A-Random-testing-in-JavaScript
Can do!
Needs random tests
Default for optional second argument should be specified in description instead of in test cases.
This comment is hidden because it contains spoiler information about the solution