Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ it.layer(TestLayer)("orchestration V2 foundation persistence", (it) => {
if (stored.event.type !== "turn-item.updated") return;
assert.equal(stored.event.payload.type, "dynamic_tool");
if (stored.event.payload.type !== "dynamic_tool") return;
assert.deepInclude(stored.event.payload.output, { truncated: true });
assert.notProperty(stored.event.payload, "output");
}
const persisted = yield* store.read({ threadId: thread.id }).pipe(Stream.runCollect);
const fullEvent = persisted.find(
Expand Down
19 changes: 15 additions & 4 deletions apps/web/src/components/files/fileEditorLanguageReadiness.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const source = "export const View = () => <div>Ready</div>;";
let pool: WorkerPoolManager;
let renderer: FileRenderer;
let terminationPromises: Promise<number>[];
const pendingAnimationFrames = new Set<ReturnType<typeof setImmediate>>();

class WorkerTransport {
private readonly worker = new NodeWorkerThreads.Worker(
Expand Down Expand Up @@ -96,10 +97,18 @@ function firstEnter(highlighter: DiffsHighlighter, file: FileContents, language:

beforeEach(async () => {
terminationPromises = [];
vi.stubGlobal("requestAnimationFrame", (callback: FrameRequestCallback) =>
setImmediate(() => callback(0)),
);
vi.stubGlobal("cancelAnimationFrame", clearImmediate);
vi.stubGlobal("requestAnimationFrame", (callback: FrameRequestCallback) => {
const handle = setImmediate(() => {
pendingAnimationFrames.delete(handle);
callback(0);
});
pendingAnimationFrames.add(handle);
return handle;
});
vi.stubGlobal("cancelAnimationFrame", (handle: ReturnType<typeof setImmediate>) => {
pendingAnimationFrames.delete(handle);
clearImmediate(handle);
});
vi.stubGlobal("window", { matchMedia: () => ({ matches: true }) });
await disposeHighlighter();
pool = new WorkerPoolManager(
Expand All @@ -116,6 +125,8 @@ afterEach(async () => {
pool?.terminate();
await Promise.all(terminationPromises);
await disposeHighlighter();
for (const handle of pendingAnimationFrames) clearImmediate(handle);
pendingAnimationFrames.clear();
vi.unstubAllGlobals();
});

Expand Down
Loading