mirror of
https://github.com/motajs/template.git
synced 2026-09-12 17:58:51 +08:00
docs(test): require test scope comments
This commit is contained in:
parent
33966fb4dd
commit
4349e67669
1
dev.md
1
dev.md
@ -82,6 +82,7 @@
|
||||
- 对于 jsDoc 注释,方法注释必须使用换行风格;对于成员 jsDoc 注释,除非注释较长需要换行,否则使用不换行的风格。
|
||||
- 代码中的注释必须包含价值,说明下一行为什么会出现,不得出现解释下一行代码等类型的无价值注释,如 `// 清空 Xxx` 就属于无价值注释。
|
||||
- jsDoc 注释应该包含主要信息,不允许假设其使用场景,非必要不使用符号或英文单词,注释的目的是让用户看完注释就立刻知道接口的用处,而不是给写代码的人看,不得为了注释的正确性而使用奇怪的语序。
|
||||
- 测试文件必须在文件顶部使用单行注释说明当前覆盖的测试内容,测试范围变化时同步更新,便于后续人工审查。
|
||||
|
||||
### 类型规范
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
// 测试 raw 地图事件校验、点事件加载和 event layer 绑定
|
||||
import { beforeAll, describe, expect, it, vi } from 'vitest';
|
||||
import {
|
||||
type IDataCommon,
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
// 测试 LayerEventView 的参考基准、dirty 状态和恢复行为
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
import { LayerEventView } from './eventView';
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
// 测试图块默认事件、点事件存读档、压缩聚合和尺寸变化
|
||||
import { beforeAll, describe, expect, it, vi } from 'vitest';
|
||||
import { type IResizableMapLayer } from './types';
|
||||
import {
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
// 测试 GameEventStore 的 add/get、未知 ID 和重复 ID 告警覆盖
|
||||
import { AnonTokyoInterpreter } from 'anon-tokyo';
|
||||
import {
|
||||
afterAll,
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
// 测试 CoreState legacy 地图初始化对 event layer 的绑定
|
||||
import { beforeAll, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
interface TestModules {
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
// 测试事件 trigger 过滤、来源环境、执行顺序、await、cut/reduce 和移动钩子
|
||||
import { beforeAll, describe, expect, it, vi } from 'vitest';
|
||||
import {
|
||||
BlockEventType,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user