Replace Instance.disposeAll/load with fixture helper (#25418)
This commit is contained in:
@@ -5,13 +5,13 @@ import { InstanceRef } from "../../src/effect/instance-ref"
|
||||
import { registerDisposer } from "../../src/effect/instance-registry"
|
||||
import { Instance } from "../../src/project/instance"
|
||||
import { InstanceStore } from "../../src/project/instance-store"
|
||||
import { tmpdirScoped } from "../fixture/fixture"
|
||||
import { disposeAllInstances, tmpdirScoped } from "../fixture/fixture"
|
||||
import { testEffect } from "../lib/effect"
|
||||
|
||||
const it = testEffect(Layer.mergeAll(InstanceStore.defaultLayer, CrossSpawnSpawner.defaultLayer))
|
||||
|
||||
afterEach(async () => {
|
||||
await Instance.disposeAll()
|
||||
await disposeAllInstances()
|
||||
})
|
||||
|
||||
describe("InstanceStore", () => {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { afterEach, describe, expect, test } from "bun:test"
|
||||
import { Effect } from "effect"
|
||||
import fs from "fs/promises"
|
||||
import path from "path"
|
||||
import { tmpdir } from "../fixture/fixture"
|
||||
import { disposeAllInstances, tmpdir } from "../fixture/fixture"
|
||||
import { AppRuntime } from "../../src/effect/app-runtime"
|
||||
import { FileWatcher } from "../../src/file/watcher"
|
||||
import { Instance } from "../../src/project/instance"
|
||||
@@ -85,7 +85,7 @@ function nextBranchUpdate(directory: string, timeout = 10_000) {
|
||||
|
||||
describeVcs("Vcs", () => {
|
||||
afterEach(async () => {
|
||||
await Instance.disposeAll()
|
||||
await disposeAllInstances()
|
||||
})
|
||||
|
||||
test("branch() returns current branch name", async () => {
|
||||
@@ -158,7 +158,7 @@ describeVcs("Vcs", () => {
|
||||
|
||||
describe("Vcs diff", () => {
|
||||
afterEach(async () => {
|
||||
await Instance.disposeAll()
|
||||
await disposeAllInstances()
|
||||
})
|
||||
|
||||
test("defaultBranch() falls back to main", async () => {
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Cause, Effect, Exit, Layer } from "effect"
|
||||
import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner"
|
||||
import { Instance } from "../../src/project/instance"
|
||||
import { Worktree } from "../../src/worktree"
|
||||
import { provideInstance, provideTmpdirInstance } from "../fixture/fixture"
|
||||
import { disposeAllInstances, provideInstance, provideTmpdirInstance } from "../fixture/fixture"
|
||||
import { testEffect } from "../lib/effect"
|
||||
|
||||
const it = testEffect(Layer.mergeAll(Worktree.defaultLayer, CrossSpawnSpawner.defaultLayer))
|
||||
@@ -37,7 +37,7 @@ async function waitReady() {
|
||||
}
|
||||
|
||||
describe("Worktree", () => {
|
||||
afterEach(() => Instance.disposeAll())
|
||||
afterEach(() => disposeAllInstances())
|
||||
|
||||
describe("makeWorktreeInfo", () => {
|
||||
it.live("returns info with name, branch, and directory", () =>
|
||||
|
||||
Reference in New Issue
Block a user