docs(test): require test scope comments

This commit is contained in:
unanmed 2026-09-09 13:12:10 +08:00
parent 33966fb4dd
commit 4349e67669
7 changed files with 7 additions and 0 deletions

1
dev.md
View File

@ -82,6 +82,7 @@
- 对于 jsDoc 注释,方法注释必须使用换行风格;对于成员 jsDoc 注释,除非注释较长需要换行,否则使用不换行的风格。
- 代码中的注释必须包含价值,说明下一行为什么会出现,不得出现解释下一行代码等类型的无价值注释,如 `// 清空 Xxx` 就属于无价值注释。
- jsDoc 注释应该包含主要信息,不允许假设其使用场景,非必要不使用符号或英文单词,注释的目的是让用户看完注释就立刻知道接口的用处,而不是给写代码的人看,不得为了注释的正确性而使用奇怪的语序。
- 测试文件必须在文件顶部使用单行注释说明当前覆盖的测试内容,测试范围变化时同步更新,便于后续人工审查。
### 类型规范

View File

@ -1,3 +1,4 @@
// 测试 raw 地图事件校验、点事件加载和 event layer 绑定
import { beforeAll, describe, expect, it, vi } from 'vitest';
import {
type IDataCommon,

View File

@ -1,3 +1,4 @@
// 测试 LayerEventView 的参考基准、dirty 状态和恢复行为
import { describe, expect, it, vi } from 'vitest';
import { LayerEventView } from './eventView';

View File

@ -1,3 +1,4 @@
// 测试图块默认事件、点事件存读档、压缩聚合和尺寸变化
import { beforeAll, describe, expect, it, vi } from 'vitest';
import { type IResizableMapLayer } from './types';
import {

View File

@ -1,3 +1,4 @@
// 测试 GameEventStore 的 add/get、未知 ID 和重复 ID 告警覆盖
import { AnonTokyoInterpreter } from 'anon-tokyo';
import {
afterAll,

View File

@ -1,3 +1,4 @@
// 测试 CoreState legacy 地图初始化对 event layer 的绑定
import { beforeAll, describe, expect, it, vi } from 'vitest';
interface TestModules {

View File

@ -1,3 +1,4 @@
// 测试事件 trigger 过滤、来源环境、执行顺序、await、cut/reduce 和移动钩子
import { beforeAll, describe, expect, it, vi } from 'vitest';
import {
BlockEventType,