@civic/hub-bridge
Version:
Stdio <-> HTTP/SSE MCP bridge with Civic auth handling
29 lines • 1.22 kB
JavaScript
/**
* Tests for CLIAuthProviderSingleton
*/
import { describe, it, expect, beforeEach } from "vitest";
import { CLIAuthProviderSingleton } from "./cli-auth-provider-singleton.js";
describe("CLIAuthProviderSingleton", () => {
beforeEach(() => {
// Reset singleton before each test
CLIAuthProviderSingleton.reset();
});
it("should return the same instance on multiple calls", () => {
const instance1 = CLIAuthProviderSingleton.getInstance();
const instance2 = CLIAuthProviderSingleton.getInstance();
expect(instance1).toBe(instance2);
});
it("should create a new instance after reset", () => {
const instance1 = CLIAuthProviderSingleton.getInstance();
CLIAuthProviderSingleton.reset();
const instance2 = CLIAuthProviderSingleton.getInstance();
expect(instance1).not.toBe(instance2);
});
it("should have correct configuration", () => {
const instance = CLIAuthProviderSingleton.getInstance();
// Verify it's a CLIAuthProvider instance
expect(instance).toBeDefined();
expect(typeof instance.tokens).toBe("function");
});
});
//# sourceMappingURL=cli-auth-provider-singleton.test.js.map