Ad
  • Custom User Avatar

    Every test reuses the same input object, so modifying the input will break the fixed tests, which would be very confusing.

    I've deep-frozen the configuration objects in a new version of this kata. Not sure if it's smart to mutate function arguments in the first place though :P

    Also, transitions in the random tests can be modified.

    They too are now deep-frozen.

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    The way I see it, there are two ways around this problem:

    1. Instead of checking for bit-to-bit accuracy, calculate the difference between test and actual images, and check if it's below a certain threshold. Problem with this is that it might allow some actual bugs go through, or it might not let a valid, but complex image go through

    2. Instead of using pre-rendered data for the test-cases, generate the test data within the tests, so that differences in canvas rendering will also be present in the test images.

  • Custom User Avatar

    Check out this page: https://browserleaks.com/canvas

    As you can see, it will give you a uniqueness percentage, of how your browser draws a set of drawing instructions. The uniqueness is likely quite high too. What this means, is that your browser produces a different image from other browsers, so by definition, expecting pixel-perfect, bit-to-bit accuracy in this Kata is misguided.

  • Custom User Avatar

    I don't like this. My perfectly valid solution is getting rejected, because of floating point errors. My math and drawing procedures are solid, but because the test cases expect bit-to-bit accuracy (which can be impossible to achieve cross-browser/cross-OS with Canvas), my solution isn't not going through.

    For example, take a look at my drawing vs. test case here: https://i.imgur.com/q0YkNSp.png
    You might not even see the difference, yet there are sub-pixel inaccuracies, and I'm absolutely sure it's not my code that's causing those. It's inherent to Canvas API implementations.

  • Custom User Avatar

    All inputs for which conversion to integer would be nonsensical (as is the case with Infinity), should return zero.

    If it helps; this kata can be completed with under 40 characters of code.

  • Custom User Avatar

    Y is most definitely a vowel where I come from. It is pronounced as a vowel in words such as happY, todaY, rhYthm, sYllable, manY, analYse and many others.

    Since this is a JavaScript test and not a test of specialized knowledge of english phonetics, I think it should be at least mentioned in the task description, if not omitted from test cases.

  • Custom User Avatar

    8008 is the correct input for 80085e-1, according to the test case as well.