From 0511a82589214b93b6915e9824a94cdf99d93ac2 Mon Sep 17 00:00:00 2001 From: onmax Date: Tue, 17 Nov 2026 22:19:25 +0100 Subject: [PATCH 1/2] test: remove assertions that can't fail tinylinkify's punctuation test compared two equal strings, so it stayed green with P()'s cache removed. tinyini's toJSON test asserted JSON.stringify's own output, which runs no tinyini code; the stringify() line above it covers the fix. --- packages/tinyini/test/root.test.ts | 3 --- packages/tinylinkify/test/linkify-it.test.ts | 5 ++--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/tinyini/test/root.test.ts b/packages/tinyini/test/root.test.ts index 64f38a9..4d90eed 100644 --- a/packages/tinyini/test/root.test.ts +++ b/packages/tinyini/test/root.test.ts @@ -138,9 +138,6 @@ describe("stringify", () => { expect(stringify({ a: key, list: [key], f: Object.assign(() => 1, key) })).toBe( "a=\nlist[]=<0>\nf=\n", ); - expect(JSON.stringify({ a: key, list: [key], f: Object.assign(() => 1, key) })).toBe( - '{"a":"","list":["<0>"],"f":""}', - ); // A toJSON getter is read once, as JSON.stringify reads it. let reads = 0; const once = { diff --git a/packages/tinylinkify/test/linkify-it.test.ts b/packages/tinylinkify/test/linkify-it.test.ts index 7d21e77..c6027dd 100644 --- a/packages/tinylinkify/test/linkify-it.test.ts +++ b/packages/tinylinkify/test/linkify-it.test.ts @@ -31,9 +31,8 @@ describe("tinylinkify/linkify-it", () => { expect(new RegExp(`^(?:${l.re.src_P})$`).test("a")).toBe(false); }); - it("reads punctuation from the engine, once", () => { - const [a, b] = [LinkifyIt(), LinkifyIt()]; - expect(a.re.src_P).toBe(b.re.src_P); + it("reads punctuation from the engine", () => { + const a = LinkifyIt(); // U+1B7F, BALINESE PANTI BAWAK, came in Unicode 16; uc.micro 2.1.0 has 15.1. const engine = /\p{P}/u.test("᭿"); expect(new RegExp(`^(?:${a.re.src_P})$`).test("᭿")).toBe(engine); From 8bf530f24bcdad61448b0aaa4578c8100ba505f1 Mon Sep 17 00:00:00 2001 From: onmax Date: Tue, 17 Nov 2026 22:59:58 +0100 Subject: [PATCH 2/2] test(tinyswap): check that each subpath is published, not its dist file name The EXPORTS test pinned each sibling's export to ./dist/.mjs, so writing an export as a conditions object turned it red with every import still resolving. It now checks the subpath is in the package's exports. --- packages/tinyswap/test/libraries.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/tinyswap/test/libraries.test.ts b/packages/tinyswap/test/libraries.test.ts index de43902..8e01d89 100644 --- a/packages/tinyswap/test/libraries.test.ts +++ b/packages/tinyswap/test/libraries.test.ts @@ -14,9 +14,9 @@ describe("EXPORTS", () => { it.each(Object.keys(EXPORTS))("lists what %s exports", async (target) => { const [tiny, subpath] = target.split("/"); const manifest = JSON.parse(readFileSync(`../${tiny}/package.json`, "utf8")) as { - exports: Record; + exports: Record; }; - expect(manifest.exports[`./${subpath}`]).toBe(`./dist/${subpath}.mjs`); + expect(Object.keys(manifest.exports)).toContain(`./${subpath}`); const source = new URL(`../../${tiny}/src/${subpath}/index.ts`, import.meta.url).href; expect(EXPORTS[target]).toEqual(Object.keys((await import(source)) as object).sort()); });