Ad
  • Custom User Avatar

    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 and Test.assertApproxEquals, and calculate expected values before actual values. ( Do not trust users not to modify their input. )

  • Custom User Avatar

    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

  • Custom User Avatar

    Can do!

  • Custom User Avatar

    Needs random tests

  • Custom User Avatar

    Default for optional second argument should be specified in description instead of in test cases.

  • Custom User Avatar

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