feat: release 2.5.1

This commit is contained in:
2026-09-27 10:40:50 +00:00 Unverified
parent 46d97138dc
commit 5f7509a9c5
53 changed files with 2871 additions and 370 deletions
+31
View File
@@ -1,5 +1,6 @@
import { describe, expect, test } from "bun:test";
import {
parseLogTailLines,
runLogs,
type LogApiEvent,
type LogEventWriter,
@@ -81,4 +82,34 @@ describe("logs API command runner", () => {
);
expect(receivedSignal).toBe(controller.signal);
});
test.each([false, true])("sends -n with follow=%s", async (follow) => {
const paths: string[] = [];
const stream: LogsApiStream = async function* (path, _init, options) {
paths.push(path);
expect(options?.timeoutMs).toBe(follow ? 0 : undefined);
yield* [] as never[];
};
await runLogs("shop", "web", follow, undefined, stream, () => {}, 0);
expect(paths).toEqual([
`/workspaces/shop/logs?service=web${follow ? "&follow=true" : ""}&tailLines=0`,
]);
});
test("accepts only non-negative safe integer line counts", async () => {
expect(parseLogTailLines("25")).toBe(25);
expect(parseLogTailLines("0")).toBe(0);
for (const invalid of ["-1", "1.5", "2abc", "", "1e3", "9007199254740992"])
expect(() => parseLogTailLines(invalid)).toThrow("non-negative integer");
let called = false;
const stream: LogsApiStream = async function* () {
called = true;
yield* [] as never[];
};
await expect(
runLogs("shop", undefined, false, undefined, stream, () => {}, -1),
).rejects.toThrow("non-negative integer");
expect(called).toBe(false);
});
});