import { jsx as _jsx } from "react/jsx-runtime";
import { describe, it, expect } from "vitest";
import { renderHook } from "@testing-library/react";
import { StigmerContext } from "../context";
import { useStigmer } from "../hooks";
describe("useStigmer", () => {
    it("throws when used outside StigmerProvider", () => {
        expect(() => renderHook(() => useStigmer())).toThrow("useStigmer must be used within <StigmerProvider>. " +
            "Wrap your component tree with <StigmerProvider client={stigmerClient}>.");
    });
    it("returns the Stigmer client when inside a provider", () => {
        const mockClient = { agent: {} };
        const wrapper = ({ children }) => (_jsx(StigmerContext.Provider, { value: mockClient, children: children }));
        const { result } = renderHook(() => useStigmer(), { wrapper });
        expect(result.current).toBe(mockClient);
    });
});
//# sourceMappingURL=hooks.test.js.map