refactor(core): convert opencode tests to nodes (#34453)

This commit is contained in:
James Long
2026-06-29 12:56:44 -04:00
committed by GitHub
parent a0ca9a0d6a
commit a216e6584a
36 changed files with 112 additions and 106 deletions
+4 -2
View File
@@ -1,4 +1,5 @@
import { expect } from "bun:test"
import { LayerNode } from "@opencode-ai/core/effect/layer-node"
import { Effect, Layer, Option } from "effect"
import { sql } from "drizzle-orm"
@@ -13,9 +14,10 @@ const truncate = Layer.effectDiscard(
yield* db.run(sql`DELETE FROM account_state`)
yield* db.run(sql`DELETE FROM account`)
}),
).pipe(Layer.provide(Database.defaultLayer))
)
const truncateNode = LayerNode.make({ name: "truncate-account", layer: truncate, deps: [Database.node] })
const it = testEffect(Layer.merge(AccountRepo.defaultLayer, truncate))
const it = testEffect(LayerNode.compile(LayerNode.group([AccountRepo.node, truncateNode])))
it.live("list returns empty when no accounts exist", () =>
Effect.gen(function* () {