Ad
  • Custom User Avatar

    If you do feel stuck on a test (often they aren't clear on what they are trying to do), the first step is to check the input and verify that things are all working as you expect them to. If you don't find any bugs, then you can try adding console.log([].slice.call(arguments.caller.callee.toString())); to the top of your function. This will show you the source of the test fixture (or at least part of it).

  • Custom User Avatar

    This is an intended feature. Knowing the tests would make you directly aware of some of the complexities you wouldn't have thought off otherwise.

    I can undertand your request, but I think the idea behind code katas and codewars is not to provide software specs so you comply to them, but to force you to write rather generic code that would hold against sneaky edge cases you might not have thought of.

    Of course the success of this approach is debatable, as I see some katas where people do just that: write something that complies to the test and that would be a dreadful piece of code to use in enterprise software.

    Maybe the issue lies more with the kata's description than with the tests. I think it's a judgment call, and it'd be hard for them to make it work both ways. It's just too bad that some katas try to have you guess while others try to enforce specs that sometime seem silly.