Ad
  • Custom User Avatar

    OP: posts unformatted code
    Also OP: " Everything is written very clearly"

    See this paragraph for info how to post your code very clearly.

  • Custom User Avatar

    Ah, okay, I figured out what is going on.

    The expectation is correct. Please, check how the doTest function works, you have its definition on your hands.

    function doTest(input, expected) {
      const actual = "your value"; // toWeirdCase(input);
      const message = `for ${JSON.stringify(input)}\n`;
      assert.strictEqual(actual, expected, message);
    }
    
    it("Sample Tests", function () {
      doTest("input value", "expected value");
    });
    

    Runner result

    So, kata is okay, your code is at fault.

    Hint: There's probably a few reasons folks say not to use global scoped variables in your code. You just managed to hit one of these reasons.

    Hint 2: this

  • Custom User Avatar

    It's impossible to figure out what your code is, use markdown to paste your code

    ```javascript
    like this
    ```    
    
  • Custom User Avatar

    Your function has a bug, it returns wrong results when it's called more than once. Try following test cases:

    doTest("YHhFiUzJ yo", 'YhHfIuZj Yo');
    doTest("YHhFiUzJ yo", 'YhHfIuZj Yo');
    

    Run both tests one after another, and you will the that the first one passes, and the second one fails.

  • Custom User Avatar

    Because your code gives a wrong answer. For the input "ZTK AUWyK Dy HqV" it should return "ZtK AuWyK Dy HqV", but returns "zTk AuWyK Dy HqV" (the first letter must be uppercase).

    Not an issue.