• Isolate imports within a given action using jest.isolateModules.

    This is a helper for the jest.isolateModules API, allowing code to avoid the clunky closure syntax in their tests.

    Type Parameters

    • T

    Parameters

    • action: (() => T)

      The action that contains the isolated module imports. We do it this way so that any require calls are relative to the calling code and not this function. Note that we don't support promises here to discourage dynamic import use, which doesn't play well with standard jest yet.

        • (): T
        • Returns T

    Returns T

Generated using TypeDoc