Ad
  • Custom User Avatar
    ReferenceError: alphabet is not defined
    
        at /workspace/node/test.js:25:32
        at Object.<anonymous> (/workspace/node/test.js:105:3)
        at Module._compile (node:internal/modules/cjs/loader:1159:14)
        at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
        at Module.load (node:internal/modules/cjs/loader:1037:32)
        at Module._load (node:internal/modules/cjs/loader:878:12)
        at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
        at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
        at async Promise.all (index 0)
        at async ESMLoader.import (node:internal/modules/esm/loader:530:24)
        at async importModuleDynamicallyWrapper (node:internal/vm/module:438:15)
        at async formattedImport (/workspace/node/node_modules/.pnpm/mocha@10.2.0/node_modules/mocha/lib/nodejs/esm-utils.js:9:14)
        at async exports.requireOrImport (/workspace/node/node_modules/.pnpm/mocha@10.2.0/node_modules/mocha/lib/nodejs/esm-utils.js:42:28)
        at async exports.loadFilesAsync (/workspace/node/node_modules/.pnpm/mocha@10.2.0/node_modules/mocha/lib/nodejs/esm-utils.js:100:20)
        at async singleRun (/workspace/node/node_modules/.pnpm/mocha@10.2.0/node_modules/mocha/lib/cli/run-helpers.js:125:3)
        at async exports.handler (/workspace/node/node_modules/.pnpm/mocha@10.2.0/node_modules/mocha/lib/cli/run.js:370:5)
    
  • Custom User Avatar

    The width of the "C" is 4 in description but 5 in tests.

  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar

    Missing imports

    • Sample tests:
    import codewars_test as test
    from solution import same_color_probability
    
    • Full tests:
    from solution import same_color_probability
    

    When all issues are solved you can republish the kata.

  • Custom User Avatar

    At least javascript:

    • Tests should fail without errors if the result is not an array.
    • Tests should accept pairs [a,b] where a > b (descritpion explicitly says that 256 -> [[8,2],...] is valid).
  • Custom User Avatar

    Duplicate?

  • Custom User Avatar
    • Returning different types (tuple/int) is bad practice. If there isn't a valid result, the function should raise an exception or return a no-value like None.
    • Random tests should always generate at least one case with elves > cookies.
  • Custom User Avatar
    f'Preparing to censor {e!r}'
    
  • Custom User Avatar

    Python:

    test.assert_equals(type(actual) in types, True, message)
    =>
    test.expect(isinstance(actual, types), message)   # avoid confusing "False should equal True" message
    

    • Don't test length/values if actual is not a tuple.
    • Don't call assert_approx_equals if len(actual) < 2 or actual[i] is not a number(*)

    (*) IMHO this is a bug in test_approx_equals, it should fail without raising exceptions if the value is not a number.

  • Custom User Avatar

    Python: function name should be snake_case

  • Custom User Avatar
    • No sample tests
    • No random tests
  • Custom User Avatar

    There is also test.assert_equals(censor(),'') without args.

  • Custom User Avatar

    $\left\lfloor\frac{\hbox{(sum of integers)}}{\hbox{(an integer)}}\right\rfloor$ is the quotient of an integer division, no floats, no rounding problems.

  • Loading more items...