refactor(core): finish test layer node conversion (#34385)

This commit is contained in:
James Long
2026-06-29 11:35:17 -04:00
committed by GitHub
parent c0e43c0c65
commit a3776429aa
60 changed files with 728 additions and 602 deletions
+6 -3
View File
@@ -1,8 +1,11 @@
import { describe, expect } from "bun:test"
import { BackgroundJob } from "@opencode-ai/core/background-job"
import { LayerNode } from "@opencode-ai/core/effect/layer-node"
import { Deferred, Effect, Exit, Scope } from "effect"
import { it } from "./lib/effect"
const jobsLayer = LayerNode.compile(BackgroundJob.node)
describe("BackgroundJob", () => {
it.live("tracks process-local work through explicit observation", () =>
Effect.gen(function* () {
@@ -25,7 +28,7 @@ describe("BackgroundJob", () => {
timedOut: false,
info: { status: "completed", output: "done" },
})
}).pipe(Effect.provide(BackgroundJob.layer)),
}).pipe(Effect.provide(jobsLayer)),
)
it.live("publishes jobs before starting immediately settling work", () =>
@@ -55,7 +58,7 @@ describe("BackgroundJob", () => {
})
})
})
}).pipe(Effect.provide(BackgroundJob.layer)),
}).pipe(Effect.provide(jobsLayer)),
)
it.live("increments pending work before starting immediately settling extensions", () =>
@@ -80,7 +83,7 @@ describe("BackgroundJob", () => {
})
}),
)
}).pipe(Effect.provide(BackgroundJob.layer)),
}).pipe(Effect.provide(jobsLayer)),
)
it.live("interrupts live work without promising settlement after the owning process-local scope closes", () =>