refactor(snapshot): remove async facade exports (#22370)

This commit is contained in:
Kit Langton
2026-04-13 21:24:54 -04:00
committed by GitHub
parent a2cb4909da
commit f40209bdfb
4 changed files with 190 additions and 195 deletions

View File

@@ -1,4 +1,5 @@
import { afterEach, describe, expect, spyOn, test } from "bun:test"
import { Effect } from "effect"
import path from "path"
import { GlobalBus } from "../../src/bus/global"
import { Snapshot } from "../../src/snapshot"
@@ -8,7 +9,7 @@ import { Server } from "../../src/server/server"
import { Filesystem } from "../../src/util/filesystem"
import { Log } from "../../src/util/log"
import { resetDatabase } from "../fixture/db"
import { tmpdir } from "../fixture/fixture"
import { provideInstance, tmpdir } from "../fixture/fixture"
Log.init({ print: false })
@@ -60,12 +61,14 @@ describe("project.initGit endpoint", () => {
worktree: tmp.path,
})
await Instance.provide({
directory: tmp.path,
fn: async () => {
expect(await Snapshot.track()).toBeTruthy()
},
})
expect(
await Effect.runPromise(
Snapshot.Service.use((svc) => svc.track()).pipe(
provideInstance(tmp.path),
Effect.provide(Snapshot.defaultLayer),
),
),
).toBeTruthy()
} finally {
await Instance.disposeAll()
reloadSpy.mockRestore()