fix(ci): stop channel timers holding vitest open · openclaw/openclaw@9c3cf35
steipete
·
2026-05-31
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | | -import { describe, expect, it, vi } from "vitest"; |
| 1 | +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; |
2 | 2 | import { MAX_TIMER_TIMEOUT_MS } from "../shared/number-coercion.js"; |
3 | 3 | import { createDraftStreamLoop } from "./draft-stream-loop.js"; |
4 | 4 | |
@@ -29,6 +29,14 @@ async function captureUnhandledRejections(
|
29 | 29 | } |
30 | 30 | |
31 | 31 | describe("createDraftStreamLoop", () => { |
| 32 | +beforeEach(() => { |
| 33 | +vi.useRealTimers(); |
| 34 | +}); |
| 35 | + |
| 36 | +afterEach(() => { |
| 37 | +vi.useRealTimers(); |
| 38 | +}); |
| 39 | + |
32 | 40 | it("contains immediate background flush rejections and preserves pending text", async () => { |
33 | 41 | await captureUnhandledRejections(async (rejections) => { |
34 | 42 | const error = new Error("send failed"); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。