Source Academy Modules
    Preparing search index...

    Function mock_function

    • Mocks a given function, allowing you to track the number of times it's been called and what values it returned with. You should call the return value from this function rather than the original value you passed in if you want the mocked function to be properly tracked.

      Parameters

      • fn: (...args: any[]) => any

        Function to mock

      Returns MockedFunction

      A mocked version of the given function.