polarity-integration-utils
    Preparing search index...

    Function createMockIntegrationContext

    • Creates a mock IntegrationContext with stubbed logger, cache, and polling methods.

      Pass your testing framework's mock function factory to enable spy capabilities (e.g., toHaveBeenCalledWith()). When omitted, plain no-op stubs are used.

      Parameters

      • createMockFn: MockFnFactory = noOp

        A factory that creates mock functions (e.g., vi.fn or jest.fn)

      Returns IntegrationContext

      A fully populated IntegrationContext with stubbed methods

      // Vitest
      const ctx = createMockIntegrationContext(vi.fn);

      // Jest
      const ctx = createMockIntegrationContext(jest.fn);

      // No framework — plain no-ops
      const ctx = createMockIntegrationContext();