• Return the function counter

    This is not tested. The solution function is referenced as counter, but the function that returns can be anonymous.

    You may have intended "Define the founction counter", but that's not right either.

    What is tested is "Define the function counter that returns a function that when invoked returns an ever increasing value."

    Why isn't the initial value a parameter to the solution function BTW? That would allow for more possibilities for testing.