Skip to content

Commit febee92

Browse files
committed
fix(lint): format test file and use optional chain per biome rules
1 parent 849ab57 commit febee92

1 file changed

Lines changed: 25 additions & 14 deletions

File tree

‎apps/site/tests/tier1-features.test.mjs‎

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,9 @@ describe("Tier 1 - Feature Coverage", () => {
10131013
};
10141014

10151015
it("7.1 API Catalog conforms to RFC 9727 and RFC 9264 linkset+json", async () => {
1016-
const apiCatalogModule = loadModule("src/pages/.well-known/api-catalog.ts");
1016+
const apiCatalogModule = loadModule(
1017+
"src/pages/.well-known/api-catalog.ts",
1018+
);
10171019
const res = await apiCatalogModule.GET({ locals });
10181020
assert.equal(res.status, 200);
10191021
assert.ok(
@@ -1022,7 +1024,9 @@ describe("Tier 1 - Feature Coverage", () => {
10221024
const data = await res.json();
10231025
assert.ok(Array.isArray(data.linkset), "Must include linkset array");
10241026
assert.ok(
1025-
data.linkset.some((e) => e.anchor === "https://codingcat.dev/api/search"),
1027+
data.linkset.some(
1028+
(e) => e.anchor === "https://codingcat.dev/api/search",
1029+
),
10261030
"Must include search anchor",
10271031
);
10281032
assert.ok(
@@ -1032,16 +1036,16 @@ describe("Tier 1 - Feature Coverage", () => {
10321036
});
10331037

10341038
it("7.2 ARD AI Catalog manifest conforms to ARD v0.9 / ai-catalog model", async () => {
1035-
const aiCatalogModule = loadModule("src/pages/.well-known/ai-catalog.json.ts");
1039+
const aiCatalogModule = loadModule(
1040+
"src/pages/.well-known/ai-catalog.json.ts",
1041+
);
10361042
const res = await aiCatalogModule.GET({ locals });
10371043
assert.equal(res.status, 200);
1038-
assert.ok(
1039-
res.headers.get("content-type")?.includes("application/json"),
1040-
);
1044+
assert.ok(res.headers.get("content-type")?.includes("application/json"));
10411045
assert.equal(res.headers.get("access-control-allow-origin"), "*");
10421046
const data = await res.json();
10431047
assert.equal(typeof data.specVersion, "string");
1044-
assert.ok(data.host && data.host.identifier);
1048+
assert.ok(data.host?.identifier);
10451049
assert.ok(Array.isArray(data.entries) && data.entries.length >= 2);
10461050
for (const entry of data.entries) {
10471051
assert.ok(entry.identifier.startsWith("urn:air:"));
@@ -1063,8 +1067,12 @@ describe("Tier 1 - Feature Coverage", () => {
10631067
});
10641068

10651069
it("7.4 OAuth & OIDC discovery metadata publishes authorization endpoints", async () => {
1066-
const oidcModule = loadModule("src/pages/.well-known/openid-configuration.ts");
1067-
const oauthServerModule = loadModule("src/pages/.well-known/oauth-authorization-server.ts");
1070+
const oidcModule = loadModule(
1071+
"src/pages/.well-known/openid-configuration.ts",
1072+
);
1073+
const oauthServerModule = loadModule(
1074+
"src/pages/.well-known/oauth-authorization-server.ts",
1075+
);
10681076

10691077
const oidcRes = await oidcModule.GET({ locals });
10701078
const oidcData = await oidcRes.json();
@@ -1075,13 +1083,18 @@ describe("Tier 1 - Feature Coverage", () => {
10751083
const oauthRes = await oauthServerModule.GET({ locals });
10761084
const oauthData = await oauthRes.json();
10771085
assert.equal(oauthData.issuer, "https://codingcat.dev");
1078-
assert.ok(oauthData.agent_auth, "Must include agent_auth block for Auth.md");
1086+
assert.ok(
1087+
oauthData.agent_auth,
1088+
"Must include agent_auth block for Auth.md",
1089+
);
10791090
assert.ok(oauthData.agent_auth.skill.includes("/auth.md"));
10801091
assert.ok(oauthData.agent_auth.register_uri);
10811092
});
10821093

10831094
it("7.5 OAuth Protected Resource Metadata (RFC 9728) points to issuer and scopes", async () => {
1084-
const prmModule = loadModule("src/pages/.well-known/oauth-protected-resource.ts");
1095+
const prmModule = loadModule(
1096+
"src/pages/.well-known/oauth-protected-resource.ts",
1097+
);
10851098
const res = await prmModule.GET({ locals });
10861099
assert.equal(res.status, 200);
10871100
const data = await res.json();
@@ -1095,9 +1108,7 @@ describe("Tier 1 - Feature Coverage", () => {
10951108
const authMdModule = loadModule("src/pages/auth.md.ts");
10961109
const res = await authMdModule.GET({ locals });
10971110
assert.equal(res.status, 200);
1098-
assert.ok(
1099-
res.headers.get("content-type")?.includes("text/markdown"),
1100-
);
1111+
assert.ok(res.headers.get("content-type")?.includes("text/markdown"));
11011112
const body = await res.text();
11021113
assert.ok(body.includes("# CodingCat.dev auth.md"));
11031114
assert.ok(body.includes("/agent/claim"));

0 commit comments

Comments
 (0)