Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

cursorUsageReader.test.ts

22 lines753 Bytes

1import { assert, describe, it } from "@effect/vitest";
2​
3import { CursorKeychainTimeoutError } from "../provider/cursorKeychainToken.ts";
4import { readCursorAccountUsage } from "./cursorUsageReader.ts";
5​
6describe("readCursorAccountUsage", () => {
7 it("asks for Keychain approval when the prompt goes unanswered", async () => {
8 const result = await readCursorAccountUsage(
9 { kind: "keychain" },
10 0,
11 1,
12 () => Promise.reject(new Error("no network expected")),
13 () => Promise.reject(new CursorKeychainTimeoutError()),
14 );
15 assert.deepStrictEqual(result, {
16 accountKey: null,
17 records: [],
18 missing: false,
19 error: "Allow Keychain access on the Mac running T3 Code, then refresh.",
20 });
21 });
22});