feat: release 2.7.0-rc2

This commit is contained in:
2026-10-06 15:31:51 +00:00 Unverified
parent cd9fb512cd
commit c8de9ddcba
42 changed files with 6127 additions and 593 deletions
+38 -2
View File
@@ -1,6 +1,13 @@
import { afterEach, describe, expect, test } from "bun:test";
import { mkdtemp, readFile, rm, stat } from "node:fs/promises";
import { join } from "node:path";
import {
mkdir,
mkdtemp,
readFile,
rm,
stat,
writeFile,
} from "node:fs/promises";
import { dirname, join } from "node:path";
import { tmpdir } from "node:os";
import {
getSessionPath,
@@ -69,6 +76,35 @@ describe("API sessions", () => {
expect(await readSession()).toBeUndefined();
});
test("removes malformed runtime sessions without caching them", async () => {
await setupDirectories();
const path = getSessionPath(false);
await mkdir(dirname(path), { recursive: true });
await writeFile(
path,
JSON.stringify({ ...session, expiresAt: "not-a-date" }),
);
expect(await readSession()).toBeUndefined();
await expect(stat(path)).rejects.toMatchObject({ code: "ENOENT" });
expect(await readSession()).toBeUndefined();
await writeSession(session, false);
expect(await readSession()).toEqual(session);
});
test("removes malformed persistent sessions", async () => {
await setupDirectories();
const path = getSessionPath(true);
await mkdir(dirname(path), { recursive: true });
await writeFile(
path,
JSON.stringify({ ...session, expiresAt: "not-a-date" }),
);
expect(await readSession()).toBeUndefined();
await expect(stat(path)).rejects.toMatchObject({ code: "ENOENT" });
});
test("invalidates a memoized missing session after writing", async () => {
await setupDirectories();
expect(await readSession()).toBeUndefined();