import assert from "node:assert/strict";
import { describe, test, vi } from "vitest";

const helperState = vi.hoisted(() => ({
	authType: undefined,
	configParams: undefined,
}));
vi.mock("@google/gemini-cli-core", () => ({
	AuthType: { LOGIN_WITH_GOOGLE: "LOGIN_WITH_GOOGLE" },
	makeFakeConfig: vi.fn((params) => {
		helperState.configParams = params;
		return { params };
	}),
}));
vi.mock("@google/gemini-cli-core/dist/src/core/contentGenerator.js", () => ({
	createContentGeneratorConfig: vi.fn(async (_config, authType) => {
		helperState.authType = authType;
		return { authType };
	}),
	createContentGenerator: vi.fn(async () => ({
		async generateContentStream() {
			return (async function* emptyStream() {})();
		},
	})),
}));

import { createGeminiCliContentGenerator } from "./index.js";

describe("google-gemini-cli-provider", () => {
	test("createGeminiCliContentGenerator_uses_google_login_auth", async () => {
		await createGeminiCliContentGenerator({ modelId: "gemini-3-pro" });
		assert.equal(helperState.authType, "LOGIN_WITH_GOOGLE");
		assert.equal(helperState.configParams?.model, "gemini-3-pro");
		assert.equal(helperState.configParams?.cwd, process.cwd());
		assert.equal(helperState.configParams?.targetDir, process.cwd());
	});
});
//# sourceMappingURL=index.test.js.map
