refactor: remove ProviderAuth facade (#21983)

This commit is contained in:
Kit Langton
2026-04-10 23:25:43 -04:00
committed by GitHub
parent 2868000c20
commit 87e23abb10
3 changed files with 27 additions and 32 deletions

View File

@@ -1,6 +1,7 @@
import { describe, expect, test } from "bun:test"
import path from "path"
import fs from "fs/promises"
import { Effect } from "effect"
import { tmpdir } from "../fixture/fixture"
import { Instance } from "../../src/project/instance"
import { ProviderAuth } from "../../src/provider/auth"
@@ -39,14 +40,18 @@ describe("plugin.auth-override", () => {
const methods = await Instance.provide({
directory: tmp.path,
fn: async () => {
return ProviderAuth.methods()
return Effect.runPromise(
ProviderAuth.Service.use((svc) => svc.methods()).pipe(Effect.provide(ProviderAuth.defaultLayer)),
)
},
})
const plainMethods = await Instance.provide({
directory: plain.path,
fn: async () => {
return ProviderAuth.methods()
return Effect.runPromise(
ProviderAuth.Service.use((svc) => svc.methods()).pipe(Effect.provide(ProviderAuth.defaultLayer)),
)
},
})