mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-03-30 05:43:55 +00:00
21 lines
549 B
TypeScript
21 lines
549 B
TypeScript
import { afterEach, expect, test } from "bun:test"
|
|
import { Auth } from "../../src/auth"
|
|
import { ProviderAuth } from "../../src/provider/auth"
|
|
import { ProviderID } from "../../src/provider/schema"
|
|
|
|
afterEach(async () => {
|
|
await Auth.remove("test-provider-auth")
|
|
})
|
|
|
|
test("ProviderAuth.api persists auth via AuthService", async () => {
|
|
await ProviderAuth.api({
|
|
providerID: ProviderID.make("test-provider-auth"),
|
|
key: "sk-test",
|
|
})
|
|
|
|
expect(await Auth.get("test-provider-auth")).toEqual({
|
|
type: "api",
|
|
key: "sk-test",
|
|
})
|
|
})
|