This reverts commit411c9338c6. 문제: #55(b4895894)가 main run 376의 FE-GATE-030(browser file/storage 제거 드릴)을 깨서 411c9338(#64)로 통째로 되돌렸다. #55의 검사기 진단과 시험 빈틈 고침 12커밋이 main에 없다. 고른 방법: 되돌림을 되돌려 #55를 그대로 다시 넣고, 드릴을 깬 원인은 다음 커밋에서 따로 고친다. 리뷰어가 이 커밋이 #55와 같은지 트리로 볼 수 있다. 이 커밋의 트리는b4895894트리에 그 뒤 main에 들어온 #63·#65만 더한 것이다(git diffb4895894<이 커밋>: docs/ledger 두 파일, cross-context-invalidation adapter 한 파일과 시험 두 파일). 버린 대안: #55 커밋 12개 cherry-pick.71606ff1merge의 충돌 해소분을 다시 풀어야 하고 결과 트리를 b4895894와 대조하기 어렵다. 위험·한계: 이 커밋만으로는 main 단계의 FE-GATE-030이 run 376처럼 실패한다(같은 트리 내용). PR 단계 게이트는 돈다. 검증: 다음 커밋 본문에 적는다. 그 커밋의 새 단언을 이 커밋의 검사기에 돌리면 실패한다(RED). Refs: #55, #64
37 lines
1.6 KiB
TypeScript
37 lines
1.6 KiB
TypeScript
import { readFile, readdir } from "node:fs/promises";
|
|
import path from "node:path";
|
|
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
const SUPPORT = "tests/e2e/support";
|
|
|
|
// 0929/11-07. The Service Worker helper kept its own copy of the checkout
|
|
// copy, the build runner and the one-occurrence edit, so a fix to one (the
|
|
// local build env of 1103/11-08, the copy skip list of 1105/12-04) had to be
|
|
// made twice. Both helpers now go through fixture-builds.ts.
|
|
describe("e2e build helpers have one copy-and-build path (0929/11-07)", () => {
|
|
it("builds Service Worker fixtures through buildEditedCopies", async () => {
|
|
const source = await readFile(path.join(SUPPORT, "service-worker-builds.ts"), "utf8");
|
|
|
|
expect(source).toMatch(/import \{[^}]*\bbuildEditedCopies\b[^}]*\} from "\.\/fixture-builds\.ts";/u);
|
|
expect(source).toContain("buildEditedCopies({");
|
|
for (const copy of ["spawnSync", "sharedFixtureBuild", "linkFixtureNodeModules", "await cp(", "function run("]) {
|
|
expect(source, copy).not.toContain(copy);
|
|
}
|
|
});
|
|
|
|
it("keeps the build runner and the one-occurrence edit in fixture-builds.ts only", async () => {
|
|
const files = (await readdir(SUPPORT)).filter((file) => file.endsWith(".ts"));
|
|
const defining = async (pattern: RegExp) => {
|
|
const found: string[] = [];
|
|
for (const file of files) {
|
|
if (pattern.test(await readFile(path.join(SUPPORT, file), "utf8"))) found.push(file);
|
|
}
|
|
return found;
|
|
};
|
|
|
|
expect(await defining(/^function run\(/mu)).toEqual(["fixture-builds.ts"]);
|
|
expect(await defining(/split\(search\)\.length !== 2/u)).toEqual(["fixture-builds.ts"]);
|
|
});
|
|
});
|