chore: sync the frontend template from ebea300 to af3d8e6
Carries 359 template commits, tag v0.2.0 plus one documentation commit: the generator-built feature index with its app, bounded-context and feature declarations, the src/platform kernel and scale tooling, the 2026-09-24 src review fixes, and the 2026-09-25 maturity review round with its CHANGELOG [보안]/[계약] rows. 691 of the 824 template paths are applied, 85 of them merged with product changes; 127 are not carried. Product identity is unchanged: name, version 0.1.0, routes, design and the TechLog domain. Three decisions worth naming. TechLog stays composed directly, as the last two syncs recorded; its directory carries a NOT_INSTALLED marker that says so, and every installed-* composer takes the template's projection with TechLog added on top. The reference sample is no longer installed: the template now installs a feature only through feature-module.ts and context-routes.ts, which load the screens this product deleted, so its three operations, six schemas and one topic leave the registries, recorded as registry change evidence. And AppRouter mounts the platform and TechLog routes only; the template's bounded-context route gateway waits for a generator-installed feature. Required fixes: readSubject on the BFF session owner (without it every HTTP Studio session would close as integration-failed), zod through the facade in nine TechLog files, noUnusedLocals, and public/config.json written out to match the local profile. Derived baselines were recomputed after reproducing both sides' values: CI contract 101 commands / 106 references / 141 artifacts, gate shape c9adcf85; registry approval 2dc6c3a3; the runtime config schema baseline equals the schema at8210d48. Verified here: types, lint, architecture, adapter inventory, CI contract, i18n, design system, diagnostics, browser security, dev release manifest, TechLog contract and build pass; 220 component, 155 integration, 15 contract, 418 TechLog, 43 reference-feature, 18 recipe and 46 release-coherence tests pass, and 2381 of 2383 unit tests. Reproduced at8210d48first and unchanged: check:registries (byte-identical), test:runtime-schema, verify:documentation. Brought by the template and escalated rather than suppressed: check:request-fanout on TechLog's cursor pagination, check:remediation-ledger (fails upstream too), the shared-chunk hash test, and the registry-dependent sample removal and second-feature tests. Playwright suites were not run. Full record, the five open questions and the follow-ups in docs/operations/template-sync-2026-09-29.md. (cherry picked from commit b2170cf265dea45dc9cc05d3c61e627e97f31cdb)
This commit is contained in:
@@ -10,11 +10,11 @@ let responseStatuses: number[] = [];
|
||||
const server = setupServer(
|
||||
http.get("https://api.test/api/entities", () => {
|
||||
const status = responseStatuses.shift() ?? 200;
|
||||
if (status === 401) {
|
||||
if (status !== 200) {
|
||||
return HttpResponse.json(
|
||||
{
|
||||
success: false,
|
||||
error: { code: "UNAUTHENTICATED" },
|
||||
error: { code: status === 401 ? "UNAUTHENTICATED" : "UNAVAILABLE" },
|
||||
meta: { requestId: "request-1", traceId: "trace-1" },
|
||||
},
|
||||
{ status },
|
||||
@@ -52,6 +52,7 @@ function createOwner(
|
||||
): ExternalSessionOwner {
|
||||
return {
|
||||
readState: () => "authenticated",
|
||||
readSubject: () => "user-a",
|
||||
subscribe: () => () => {},
|
||||
beginSignIn: async () => {},
|
||||
signOut: async () => {},
|
||||
@@ -104,6 +105,35 @@ describe("bounded 401 session recovery", () => {
|
||||
expect(notifyUnauthenticated).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
// Q-6.3-11. Recovery is its own single replay, not a retry: an exhausted or
|
||||
// disabled retry budget must not turn a recoverable 401 into a logout.
|
||||
it.each([
|
||||
{ label: "retries are disabled", statuses: [401, 200], maxRetryAttempts: 0 },
|
||||
{
|
||||
label: "a 503 already used the retry budget",
|
||||
statuses: [503, 401, 200],
|
||||
maxRetryAttempts: 1,
|
||||
},
|
||||
])("recovers a 401 when $label", async ({ statuses, maxRetryAttempts }) => {
|
||||
responseStatuses = [...statuses];
|
||||
const recoverSession = vi.fn(async () => "restored" as const);
|
||||
const notifyUnauthenticated = vi.fn();
|
||||
const client = testClient({
|
||||
baseUrl: "https://api.test",
|
||||
authSession: createExternalAuthSessionAdapter(
|
||||
createOwner({ recoverSession, notifyUnauthenticated }),
|
||||
),
|
||||
clock,
|
||||
maxRetryAttempts,
|
||||
});
|
||||
|
||||
await expect(client.execute("LIST_ENTITIES")).resolves.toMatchObject({
|
||||
ok: true,
|
||||
});
|
||||
expect(recoverSession).toHaveBeenCalledTimes(1);
|
||||
expect(notifyUnauthenticated).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("normalizes attach and invalid recovery failures", async () => {
|
||||
const attachFailure = createExternalAuthSessionAdapter(createOwner({
|
||||
attachCredential: async () => {
|
||||
|
||||
@@ -3,7 +3,10 @@ import { setupServer } from "msw/node";
|
||||
import { afterAll, afterEach, beforeAll, describe, expect, it } from "vitest";
|
||||
|
||||
import { createHttpClient } from "../../src/adapters/http/client.ts";
|
||||
import { TEST_HTTP_CONTRACT } from "../helpers/http-contract-fixture.ts";
|
||||
import {
|
||||
TEST_HTTP_CONTRACT,
|
||||
TEST_OPERATIONS,
|
||||
} from "../helpers/http-contract-fixture.ts";
|
||||
|
||||
let attempts = 0;
|
||||
const server = setupServer(
|
||||
@@ -75,6 +78,7 @@ describe("shared HTTP client", () => {
|
||||
clock,
|
||||
authSession: {
|
||||
getState: () => "authenticated",
|
||||
getSubject: () => "user-a",
|
||||
subscribe: () => () => {},
|
||||
beginSignIn: async () => {},
|
||||
signOut: async () => {},
|
||||
@@ -122,6 +126,7 @@ describe("shared HTTP client", () => {
|
||||
clock: { now: () => 0, sleep: async () => {} },
|
||||
authSession: {
|
||||
getState: () => "authenticated",
|
||||
getSubject: () => "user-a",
|
||||
subscribe: () => () => {},
|
||||
beginSignIn: async () => {},
|
||||
signOut: async () => {},
|
||||
@@ -145,7 +150,7 @@ describe("shared HTTP client", () => {
|
||||
server.use(
|
||||
http.get(
|
||||
"https://api.test/api/entities",
|
||||
() => new HttpResponse("<secret>raw body</secret>", { status: 502 }),
|
||||
() => new HttpResponse("<secret>raw body</secret>", { status: 200 }),
|
||||
),
|
||||
);
|
||||
const client = testClient({ baseUrl: "https://api.test", clock });
|
||||
@@ -158,6 +163,256 @@ describe("shared HTTP client", () => {
|
||||
expect(JSON.stringify(result)).not.toContain("raw body");
|
||||
});
|
||||
|
||||
// Q-6.3-3b. A gateway 5xx/408/425 with an HTML, empty or broken body is a
|
||||
// server outage, not a contract breach: it keeps its status and the V2
|
||||
// SERVER_FAILURE retry rule (408/425/502/503/504, R3-1).
|
||||
it.each([
|
||||
{ status: 502, contentType: "text/html", body: "<secret>raw body</secret>", fetches: 3 },
|
||||
{ status: 503, contentType: "application/json", body: "", fetches: 3 },
|
||||
{ status: 504, contentType: "application/json", body: "{", fetches: 3 },
|
||||
{ status: 408, contentType: "text/plain", body: "timeout", fetches: 3 },
|
||||
{ status: 425, contentType: "text/html", body: "<p>too early</p>", fetches: 3 },
|
||||
])(
|
||||
"keeps a $status gateway body as a server failure with its status",
|
||||
async ({ status, contentType, body, fetches }) => {
|
||||
let fetched = 0;
|
||||
server.use(
|
||||
http.get("https://api.test/api/entities", () => {
|
||||
fetched += 1;
|
||||
return new HttpResponse(body, {
|
||||
status,
|
||||
headers: { "Content-Type": contentType },
|
||||
});
|
||||
}),
|
||||
);
|
||||
const client = testClient({
|
||||
baseUrl: "https://api.test",
|
||||
clock,
|
||||
random: () => 0,
|
||||
});
|
||||
const result = await client.execute("LIST_ENTITIES");
|
||||
|
||||
expect(result).toMatchObject({
|
||||
ok: false,
|
||||
error: { kind: "SERVER_FAILURE", httpStatus: status },
|
||||
});
|
||||
expect(fetched).toBe(fetches);
|
||||
expect(JSON.stringify(result)).not.toContain("raw body");
|
||||
},
|
||||
);
|
||||
|
||||
const errorEnvelope = {
|
||||
success: false,
|
||||
error: { code: "UPSTREAM_BUSY" },
|
||||
meta: { requestId: "request-1", traceId: "trace-1" },
|
||||
};
|
||||
|
||||
// A gateway body (not an envelope) or a valid V2 error envelope.
|
||||
function busyResponse(
|
||||
status: number,
|
||||
envelope: boolean,
|
||||
headers: Record<string, string> = {},
|
||||
) {
|
||||
return envelope
|
||||
? HttpResponse.json(errorEnvelope, { status, headers })
|
||||
: new HttpResponse("busy", {
|
||||
status,
|
||||
headers: { "Content-Type": "text/plain", ...headers },
|
||||
});
|
||||
}
|
||||
|
||||
const busyCases = [408, 425, 503].flatMap((status) => [
|
||||
{ status, envelope: false },
|
||||
{ status, envelope: true },
|
||||
]);
|
||||
|
||||
// R3-1. A 408/425 with a valid error envelope is a server failure in V2 and
|
||||
// keeps the backend code the envelope carries.
|
||||
it.each([408, 425, 503])(
|
||||
"retries a safe request on a %i error envelope and keeps its code",
|
||||
async (status) => {
|
||||
let fetched = 0;
|
||||
server.use(
|
||||
http.get("https://api.test/api/entities", () => {
|
||||
fetched += 1;
|
||||
return busyResponse(status, true);
|
||||
}),
|
||||
);
|
||||
const client = testClient({
|
||||
baseUrl: "https://api.test",
|
||||
clock,
|
||||
random: () => 0,
|
||||
});
|
||||
|
||||
await expect(client.execute("LIST_ENTITIES")).resolves.toMatchObject({
|
||||
ok: false,
|
||||
error: {
|
||||
kind: "SERVER_FAILURE",
|
||||
code: "UPSTREAM_BUSY",
|
||||
httpStatus: status,
|
||||
requestId: "request-1",
|
||||
},
|
||||
});
|
||||
expect(fetched).toBe(3);
|
||||
},
|
||||
);
|
||||
|
||||
// R3-1. 408/425/503 follow the retry rule of the operation: a keyed command
|
||||
// may replay, a non-idempotent command is never replayed.
|
||||
it.each(
|
||||
busyCases.flatMap((busy) => [
|
||||
{ ...busy, idempotency: "none" as const, fetches: 1 },
|
||||
{ ...busy, idempotency: "keyed" as const, fetches: 3 },
|
||||
]),
|
||||
)(
|
||||
"sends a $idempotency command $fetches time(s) on $status (envelope: $envelope)",
|
||||
async ({ status, envelope, idempotency, fetches }) => {
|
||||
let fetched = 0;
|
||||
server.use(
|
||||
http.post("https://api.test/api/entities", () => {
|
||||
fetched += 1;
|
||||
return busyResponse(status, envelope);
|
||||
}),
|
||||
);
|
||||
const client = testClient({
|
||||
baseUrl: "https://api.test",
|
||||
clock,
|
||||
random: () => 0,
|
||||
getOperation: () => ({ ...TEST_OPERATIONS.CREATE_ENTITY, idempotency }),
|
||||
});
|
||||
const result = await client.execute("CREATE_ENTITY", {
|
||||
body: { name: "n" },
|
||||
...(idempotency === "keyed" ? { idempotencyKey: "key-1" } : {}),
|
||||
});
|
||||
|
||||
expect(result).toMatchObject({
|
||||
ok: false,
|
||||
error: { kind: "SERVER_FAILURE", httpStatus: status },
|
||||
});
|
||||
expect(fetched).toBe(fetches);
|
||||
},
|
||||
);
|
||||
|
||||
function retryAfterClient(delays: number[]) {
|
||||
return testClient({
|
||||
baseUrl: "https://api.test",
|
||||
clock: {
|
||||
now: () => 0,
|
||||
sleep: async (ms: number) => {
|
||||
delays.push(ms);
|
||||
},
|
||||
},
|
||||
random: () => 0.5, // local backoff for the first retry: 125ms
|
||||
});
|
||||
}
|
||||
|
||||
function listAfter(first: () => Response) {
|
||||
let fetched = 0;
|
||||
server.use(
|
||||
http.get("https://api.test/api/entities", () => {
|
||||
fetched += 1;
|
||||
return fetched === 1
|
||||
? first()
|
||||
: HttpResponse.json({
|
||||
success: true,
|
||||
data: [],
|
||||
meta: { requestId: "request-1", traceId: "trace-1" },
|
||||
});
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
// R3-1. The retry waits at least the Retry-After of a 408/425/503, under
|
||||
// the same 30s ceiling as a 429.
|
||||
it.each(busyCases)(
|
||||
"waits for the Retry-After of a $status (envelope: $envelope)",
|
||||
async ({ status, envelope }) => {
|
||||
listAfter(() => busyResponse(status, envelope, { "Retry-After": "2" }));
|
||||
const delays: number[] = [];
|
||||
await expect(
|
||||
retryAfterClient(delays).execute("LIST_ENTITIES"),
|
||||
).resolves.toMatchObject({ ok: true });
|
||||
expect(delays).toEqual([2_000]);
|
||||
},
|
||||
);
|
||||
|
||||
// R3-1. 502/504 keep the local backoff whatever Retry-After says.
|
||||
it.each([502, 504])(
|
||||
"ignores the Retry-After of a %i",
|
||||
async (status) => {
|
||||
listAfter(() => busyResponse(status, true, { "Retry-After": "2" }));
|
||||
const delays: number[] = [];
|
||||
await expect(
|
||||
retryAfterClient(delays).execute("LIST_ENTITIES"),
|
||||
).resolves.toMatchObject({ ok: true });
|
||||
expect(delays).toEqual([125]);
|
||||
},
|
||||
);
|
||||
|
||||
it.each(busyCases)(
|
||||
"does not retry a $status whose Retry-After exceeds 30 seconds (envelope: $envelope)",
|
||||
async ({ status, envelope }) => {
|
||||
let fetched = 0;
|
||||
server.use(
|
||||
http.get("https://api.test/api/entities", () => {
|
||||
fetched += 1;
|
||||
return busyResponse(status, envelope, { "Retry-After": "31" });
|
||||
}),
|
||||
);
|
||||
const delays: number[] = [];
|
||||
await expect(
|
||||
retryAfterClient(delays).execute("LIST_ENTITIES"),
|
||||
).resolves.toMatchObject({
|
||||
ok: false,
|
||||
error: { kind: "SERVER_FAILURE", httpStatus: status, retryAfterMs: 31_000 },
|
||||
});
|
||||
expect(fetched).toBe(1);
|
||||
expect(delays).toEqual([]);
|
||||
},
|
||||
);
|
||||
|
||||
// R3-1. Retry-After goes through the platform kernel parser: delta-seconds
|
||||
// or an IMF-fixdate only. Anything else falls back to the local backoff.
|
||||
it.each([
|
||||
{ value: "2", delay: 2_000 },
|
||||
{ value: " 2 ", delay: 2_000 },
|
||||
{ value: "Thu, 01 Jan 1970 00:00:05 GMT", delay: 5_000 },
|
||||
{ value: "", delay: 125 },
|
||||
{ value: " ", delay: 125 },
|
||||
{ value: "1e3", delay: 125 },
|
||||
{ value: "1.5", delay: 125 },
|
||||
{ value: "0x10", delay: 125 },
|
||||
{ value: "-1", delay: 125 },
|
||||
{ value: "2099-01-01T00:00:00Z", delay: 125 },
|
||||
{ value: "Thursday, 01-Jan-70 00:00:05 GMT", delay: 125 },
|
||||
])("parses a 429 Retry-After of $value as $delay ms", async ({ value, delay }) => {
|
||||
let fetched = 0;
|
||||
server.use(
|
||||
http.get("https://api.test/api/entities", () => {
|
||||
fetched += 1;
|
||||
return fetched === 1
|
||||
? HttpResponse.json(
|
||||
{
|
||||
success: false,
|
||||
error: { code: "RATE_LIMITED" },
|
||||
meta: { requestId: "request-1", traceId: "trace-1" },
|
||||
},
|
||||
{ status: 429, headers: { "Retry-After": value } },
|
||||
)
|
||||
: HttpResponse.json({
|
||||
success: true,
|
||||
data: [],
|
||||
meta: { requestId: "request-1", traceId: "trace-1" },
|
||||
});
|
||||
}),
|
||||
);
|
||||
const delays: number[] = [];
|
||||
await expect(
|
||||
retryAfterClient(delays).execute("LIST_ENTITIES"),
|
||||
).resolves.toMatchObject({ ok: true });
|
||||
expect(delays).toEqual([delay]);
|
||||
});
|
||||
|
||||
it("classifies malformed JSON and invalid payloads at the boundary", async () => {
|
||||
server.use(
|
||||
http.get(
|
||||
|
||||
@@ -281,6 +281,50 @@ describe("LIVE-01 credential integration failures are not user session failures"
|
||||
);
|
||||
});
|
||||
|
||||
/**
|
||||
* R-3.4. Fetch rejects a header value that is not a control-free ByteString.
|
||||
* Letting that reach `fetch()` reported an auth defect as a network failure
|
||||
* after dispatch (MAYBE_APPLIED for a command).
|
||||
*/
|
||||
it.each([
|
||||
["NUL", "Bearer abc\u0000def"],
|
||||
["non-Latin-1", "Bearer 한"],
|
||||
])(
|
||||
"rejects a %s credential value before dispatch",
|
||||
async (_label, value) => {
|
||||
const fetcher = vi.fn(
|
||||
async (_url: RequestInfo | URL, init?: RequestInit) => {
|
||||
new Headers(init?.headers);
|
||||
return jsonResponse([]);
|
||||
},
|
||||
);
|
||||
const executor = createContractHttpExecutor({
|
||||
baseUrl: "https://api.example/",
|
||||
maxRetryAttempts: 0,
|
||||
authProfiles: TEST_PROFILES,
|
||||
attachCredentials: () =>
|
||||
Object.freeze({
|
||||
kind: "READY" as const,
|
||||
headers: Object.freeze({ authorization: value }),
|
||||
}),
|
||||
fetcher: fetcher as unknown as typeof fetch,
|
||||
});
|
||||
|
||||
const outcome = await executor.execute(
|
||||
bearerOperation(),
|
||||
{ limit: 1 },
|
||||
{ routeId: ROUTE_ID, scope: scopeSnapshot() },
|
||||
);
|
||||
|
||||
expect(outcome).toMatchObject({
|
||||
kind: "AUTH_INTEGRATION_FAILURE",
|
||||
reason: "CREDENTIAL_HEADER_VALUE_INVALID",
|
||||
effect: "NOT_APPLICABLE",
|
||||
});
|
||||
expect(fetcher).not.toHaveBeenCalled();
|
||||
},
|
||||
);
|
||||
|
||||
it("still reports a real absent session as UNAUTHENTICATED", async () => {
|
||||
const fetcher = vi.fn(async () => jsonResponse([]));
|
||||
const executor = createContractHttpExecutor({
|
||||
|
||||
@@ -182,6 +182,72 @@ describe("V3 HTTP observability projection", () => {
|
||||
expect(sinks.diagnostics).toHaveLength(1);
|
||||
});
|
||||
|
||||
it("records the correlation id in diagnostics only (03-03)", async () => {
|
||||
const sinks = recordingSinks();
|
||||
const executor = createContractHttpExecutor({
|
||||
baseUrl: "https://api.example/",
|
||||
maxRetryAttempts: 0,
|
||||
attachCredentials: () => ({ kind: "READY" as const, headers: {} }),
|
||||
fetcher: (async () =>
|
||||
new Response(null, {
|
||||
status: 503,
|
||||
headers: { "x-correlation-id": "server-ref-7" },
|
||||
})) as unknown as typeof fetch,
|
||||
observe: sinks.projector,
|
||||
});
|
||||
|
||||
await executor.execute(
|
||||
TEST_LIST_HTTP_CONTRACT,
|
||||
{ limit: 5 },
|
||||
{ routeId: ROUTE_ID, scope: scopeSnapshot() },
|
||||
);
|
||||
|
||||
expect(sinks.diagnostics[0]?.context).toMatchObject({
|
||||
correlation_id: "server-ref-7",
|
||||
});
|
||||
expect(projectDiagnosticRecord(sinks.diagnostics[0]!).success).toBe(true);
|
||||
expect(sinks.telemetry).toHaveLength(1);
|
||||
expect(JSON.stringify(sinks.telemetry)).not.toContain("server-ref-7");
|
||||
});
|
||||
|
||||
it("keeps a never-sent unauthenticated request out of telemetry (03-07)", async () => {
|
||||
const sinks = recordingSinks();
|
||||
const fetcher = vi.fn();
|
||||
const executor = createContractHttpExecutor({
|
||||
baseUrl: "https://api.example/",
|
||||
maxRetryAttempts: 0,
|
||||
attachCredentials: () => ({ kind: "UNAUTHENTICATED" as const }),
|
||||
fetcher: fetcher as unknown as typeof fetch,
|
||||
observe: sinks.projector,
|
||||
});
|
||||
|
||||
const outcome = await executor.execute(
|
||||
TEST_LIST_HTTP_CONTRACT,
|
||||
{ limit: 5 },
|
||||
{ routeId: ROUTE_ID, scope: scopeSnapshot() },
|
||||
);
|
||||
|
||||
expect(outcome.kind).toBe("UNAUTHENTICATED");
|
||||
expect(fetcher).not.toHaveBeenCalled();
|
||||
expect(sinks.diagnostics).toHaveLength(1);
|
||||
expect(sinks.telemetry).toHaveLength(0);
|
||||
|
||||
// A server 401 is still an API failure.
|
||||
const answered = recordingSinks();
|
||||
await createContractHttpExecutor({
|
||||
baseUrl: "https://api.example/",
|
||||
maxRetryAttempts: 0,
|
||||
attachCredentials: () => ({ kind: "READY" as const, headers: {} }),
|
||||
fetcher: (async () => new Response(null, { status: 401 })) as unknown as typeof fetch,
|
||||
observe: answered.projector,
|
||||
}).execute(
|
||||
TEST_LIST_HTTP_CONTRACT,
|
||||
{ limit: 5 },
|
||||
{ routeId: ROUTE_ID, scope: scopeSnapshot() },
|
||||
);
|
||||
expect(answered.telemetry).toHaveLength(1);
|
||||
});
|
||||
|
||||
it("does not emit failure telemetry for caller cancellation or scope fencing", async () => {
|
||||
const cancelled = recordingSinks();
|
||||
const callerController = new AbortController();
|
||||
|
||||
@@ -15,7 +15,10 @@ import {
|
||||
RELEASE_CANDIDATE_MANIFEST_PATH,
|
||||
releaseCandidateManifestSchema,
|
||||
} from "../../scripts/lib/release-candidate.ts";
|
||||
import { linkFixtureNodeModules } from "../../scripts/lib/fixture-node-modules.ts";
|
||||
import {
|
||||
FIXTURE_PNPM_ENVIRONMENT,
|
||||
linkFixtureNodeModules,
|
||||
} from "../../scripts/lib/fixture-node-modules.ts";
|
||||
|
||||
it(
|
||||
"builds a real candidate assessment and passes the default archived verifier from the captured archive",
|
||||
@@ -61,6 +64,7 @@ it(
|
||||
maxBuffer: 32 * 1024 * 1024,
|
||||
env: {
|
||||
...process.env,
|
||||
...FIXTURE_PNPM_ENVIRONMENT,
|
||||
CI: "true",
|
||||
VITE_BUILD_ID: "security-followup-integration",
|
||||
VITE_COMMIT_SHA: revision,
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
import { spawnSync } from "node:child_process";
|
||||
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
function listTestFiles(...filters: string[]): string[] {
|
||||
const result = spawnSync(
|
||||
process.execPath,
|
||||
["node_modules/vitest/vitest.mjs", "list", "--filesOnly", ...filters],
|
||||
{ encoding: "utf8" },
|
||||
);
|
||||
expect(result.status, result.stderr).toBe(0);
|
||||
return result.stdout.split("\n").filter((line) => line.length > 0);
|
||||
}
|
||||
|
||||
describe("Vitest file collection", () => {
|
||||
it("leaves Playwright specs and host system tests out of a bare run", () => {
|
||||
const files = listTestFiles();
|
||||
|
||||
expect(files).toContain("tests/integration/vitest-collection.test.ts");
|
||||
expect(files.filter((file) => file.endsWith(".spec.ts"))).toEqual([]);
|
||||
expect(files.filter((file) => file.startsWith("tests/system/"))).toEqual(
|
||||
[],
|
||||
);
|
||||
}, 30_000);
|
||||
|
||||
it("still collects system tests when test:system names them", () => {
|
||||
expect(listTestFiles("tests/system")).toContain(
|
||||
"tests/system/ci-runner/ci-evidence-freshness.test.ts",
|
||||
);
|
||||
}, 30_000);
|
||||
});
|
||||
Reference in New Issue
Block a user