chore: harden release checks and package coverage
Quality / quality (ubuntu-latest) (push) Failing after 9m57s
Quality / quality (windows-latest) (push) Canceled after 0s

This commit is contained in:
2026-08-24 11:36:13 +05:30
parent 354082ebc3
commit e372ae571a
24 changed files with 563 additions and 279 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@wrnexus/syntax",
"version": "0.8.13",
"version": "0.8.15",
"type": "module",
"main": "src/index.ts",
"exports": {
@@ -0,0 +1,28 @@
import { expect, test } from "bun:test";
import { hasRequestSection, parseApiEntries, parseApiSections } from "../src/api-sections.ts";
test("api section scanning ignores keywords in literals, comments, and nested objects", () => {
const source = `
// request { body { forged: string } }
response {
return { label: "request { not a section }", nested: { body: true } }
}
`;
expect(hasRequestSection(source)).toBe(false);
expect(parseApiSections(source)?.response).toContain("nested");
});
test("api entries normalize methods and reject malformed request fields", () => {
expect(
parseApiEntries(`lookup get /users/:id {
response { return data }
}`)[0],
).toMatchObject({
name: "lookup",
method: "GET",
path: "/users/:id",
});
expect(() =>
parseApiSections("request { body { missingType } } response { return data }"),
).toThrow('Expected "name: type"');
});