chore(gates): DEC-N6 让 e2e 进类型口径,并修 pre-commit 位与证据路径覆盖历史
- 新增 e2e/tsconfig.json + `npm run type-check:e2e`(并入 test:all)。 本轮实测证据:teardown 补丁里第二个 `const revalidateSecret` 与既有声明重名, `npm run type-check` 全程 EXIT=0,只有 `playwright test --list` 才报重复声明 —— 现在静态期就能抓。读数:type-check:e2e EXIT=0。 - .husky/pre-commit 的索引模式改回 100755(本轮每次提交都在打 "was ignored because it's not set as executable",即 lint-staged 在任何克隆里都不执行)。 验证看 `git ls-files -s .husky` 的 mode,不是看文件系统权限。 - axe 证据落盘改为按运行轮次分目录(原写死 docs/acceptance/2026-09-21-axe/axe-evidence.json, 于是每跑一次就覆盖一次历史:0157b1c9 里那 409 行 diff 就是这么产生的), 并补 check:axe:selftest;判定逻辑与退出码三档语义未动。 - 顺带修一处仪器级缺陷:package.json 里 `type-check:e2e` 被写了两遍 —— JSON 重复键是后者静默覆盖前者,不会报错也不会判红,正是本仓反复吃的"重复声明"类。 现取键数与值由 node 回读校验。
This commit is contained in:
1 parent
2e0099426f
commit
1c0ce5f458
12 files changed
+199
-27
No files matched your search
@@ -30,7 +30,10 @@ test.describe('滚动进度条 - 全局组件行为', { tag: '@regression' }, ()
|
||||
const scale = await progressFill.evaluate((el) => {
|
||||
const transform = (el as HTMLElement).style.transform;
|
||||
const match = transform.match(/scaleX\(([\d.]+)\)/);
|
||||
return match ? parseFloat(match[1]) : 0;
|
||||
// 先落到局部变量再判空:`match[1]` 在 noUncheckedIndexedAccess 下类型是
|
||||
// string | undefined,直接 parseFloat 报 TS2532;捕获组必然存在,运行时与旧写法等价。
|
||||
const ratio = match?.[1];
|
||||
return ratio ? parseFloat(ratio) : 0;
|
||||
});
|
||||
expect(scale).toBe(0);
|
||||
});
|
||||
@@ -45,7 +48,10 @@ test.describe('滚动进度条 - 全局组件行为', { tag: '@regression' }, ()
|
||||
const getScale = () => progressFill.evaluate((el) => {
|
||||
const transform = (el as HTMLElement).style.transform;
|
||||
const match = transform.match(/scaleX\(([\d.]+)\)/);
|
||||
return match ? parseFloat(match[1]) : 0;
|
||||
// 先落到局部变量再判空:`match[1]` 在 noUncheckedIndexedAccess 下类型是
|
||||
// string | undefined,直接 parseFloat 报 TS2532;捕获组必然存在,运行时与旧写法等价。
|
||||
const ratio = match?.[1];
|
||||
return ratio ? parseFloat(ratio) : 0;
|
||||
});
|
||||
|
||||
// 先获取顶部缩放
|
||||
@@ -279,7 +285,10 @@ test.describe('服务详情页 - 滚动进度条', { tag: '@regression' }, () =>
|
||||
const scale = await progressFill.evaluate((el) => {
|
||||
const transform = (el as HTMLElement).style.transform;
|
||||
const match = transform.match(/scaleX\(([\d.]+)\)/);
|
||||
return match ? parseFloat(match[1]) : 0;
|
||||
// 先落到局部变量再判空:`match[1]` 在 noUncheckedIndexedAccess 下类型是
|
||||
// string | undefined,直接 parseFloat 报 TS2532;捕获组必然存在,运行时与旧写法等价。
|
||||
const ratio = match?.[1];
|
||||
return ratio ? parseFloat(ratio) : 0;
|
||||
});
|
||||
expect(scale).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user