mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 19:21:23 +00:00
perf(test): dedupe telegram/node coverage and speed fixtures
This commit is contained in:
@@ -89,7 +89,10 @@ vi.mock("./session.js", () => {
|
||||
import { monitorWebInbox, resetWebInboundDedupe } from "./inbound.js";
|
||||
|
||||
async function waitForMessage(onMessage: ReturnType<typeof vi.fn>) {
|
||||
await vi.waitFor(() => expect(onMessage).toHaveBeenCalledTimes(1));
|
||||
await vi.waitFor(() => expect(onMessage).toHaveBeenCalledTimes(1), {
|
||||
interval: 1,
|
||||
timeout: 250,
|
||||
});
|
||||
return onMessage.mock.calls[0][0];
|
||||
}
|
||||
|
||||
|
||||
@@ -40,8 +40,8 @@ beforeAll(async () => {
|
||||
fixtureRoot = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-media-test-"));
|
||||
largeJpegBuffer = await sharp({
|
||||
create: {
|
||||
width: 900,
|
||||
height: 900,
|
||||
width: 800,
|
||||
height: 800,
|
||||
channels: 3,
|
||||
background: "#ff0000",
|
||||
},
|
||||
@@ -63,7 +63,7 @@ beforeAll(async () => {
|
||||
})
|
||||
.png()
|
||||
.toBuffer();
|
||||
const size = 96;
|
||||
const size = 72;
|
||||
const raw = buildDeterministicBytes(size * size * 4);
|
||||
fallbackPngBuffer = await sharp(raw, { raw: { width: size, height: size, channels: 4 } })
|
||||
.png()
|
||||
|
||||
Reference in New Issue
Block a user