Skip to content

Commit ed3a1a5

Browse files
test(server): drop dead workspace mocks and a test that passes on main
AI-assisted; verified with the tests and tools listed above.
1 parent 2c1b514 commit ed3a1a5

2 files changed

Lines changed: 0 additions & 41 deletions

File tree

‎apps/server/src/orchestration-v2/RunFinalizationService.test.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ it.effect("returns from the post-turn refresh without waiting for the PR lookup"
148148
const layer = RunFinalization.layerObserver.pipe(
149149
Layer.provide(
150150
Layer.mergeAll(
151-
Layer.mock(WorkspaceEntries.WorkspaceEntries)({ refresh: () => Effect.void }),
152151
Layer.mock(PullRequestService.PullRequestService)({
153152
refreshAfterTurn: () => Effect.void,
154153
}),
@@ -198,7 +197,6 @@ it.effect("replaces a still-running PR lookup when a newer turn finishes", () =>
198197
const layer = RunFinalization.layerObserver.pipe(
199198
Layer.provide(
200199
Layer.mergeAll(
201-
Layer.mock(WorkspaceEntries.WorkspaceEntries)({ refresh: () => Effect.void }),
202200
Layer.mock(PullRequestService.PullRequestService)({
203201
refreshAfterTurn: () => Effect.void,
204202
}),

‎apps/server/src/workspace/WorkspaceSearchIndex.test.ts‎

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
} from "@ff-labs/fff-node";
88
import { afterEach, expect, it } from "@effect/vitest";
99
import * as Effect from "effect/Effect";
10-
import * as TestClock from "effect/testing/TestClock";
1110
import { vi } from "vite-plus/test";
1211

1312
import * as WorkspaceSearchIndex from "./WorkspaceSearchIndex.ts";
@@ -29,44 +28,6 @@ function fileItem(relativePath: string): FileItem {
2928
};
3029
}
3130

32-
it.effect("reads never rescan after the former recovery interval", () =>
33-
Effect.scoped(
34-
Effect.gen(function* () {
35-
const scanFiles = vi.fn(() => ({ ok: true as const, value: undefined }));
36-
const finder = {
37-
destroy: vi.fn(),
38-
waitForIndexReady: vi.fn(async () => ({ ok: true as const, value: true })),
39-
scanFiles,
40-
mixedSearch: () => ({ ok: true as const, value: { items: [], totalMatched: 0 } }),
41-
fileSearch: () => ({
42-
ok: true as const,
43-
value: { items: [fileItem("watched.ts")], scores: [], totalMatched: 1, totalFiles: 1 },
44-
}),
45-
grep: () => ({ ok: true as const, value: { items: [], nextCursor: null } }),
46-
} as unknown as FileFinder;
47-
vi.spyOn(FileFinder, "create").mockReturnValueOnce({ ok: true, value: finder });
48-
const index = yield* WorkspaceSearchIndex.make("/workspace/project");
49-
yield* TestClock.adjust("10 minutes");
50-
expect(yield* index.list()).toEqual({ entries: [], truncated: false });
51-
expect((yield* index.search("", 10, "file")).entries).toEqual([
52-
{ path: "watched.ts", kind: "file" },
53-
]);
54-
expect(
55-
yield* index.searchContents({
56-
query: "needle",
57-
limit: 1,
58-
caseSensitive: true,
59-
wholeWord: false,
60-
useRegex: false,
61-
}),
62-
).toEqual({ matches: [], truncated: false });
63-
expect(scanFiles).not.toHaveBeenCalled();
64-
yield* index.refresh();
65-
expect(scanFiles).toHaveBeenCalledTimes(1);
66-
}),
67-
),
68-
);
69-
7031
it.effect("filters image searches before applying the result limit", () =>
7132
Effect.scoped(
7233
Effect.gen(function* () {

0 commit comments

Comments
 (0)