Ad
  • Custom User Avatar

    Test should contain 0 repeats... which makes clear how the spec has gaps.

    Repeat 0 should return the original.
    Repeat 1 should return the original and a repeat. If I repeat something, it's said twice.

    OR

    Repeat 0 returns empty string, Repeat 1 returns the original string.

    {
    expected: '',
    actual: 'ho '.repeat(0),
    msg: ''ho '.repeat(0) should return an empty string'
    },

  • Custom User Avatar

    Pick one:

    • Function should return NaN.
    • Unit test framework cannot test for NaN.

    assertEqual(min("1",1), NaN) should probably not fail for this example...