mirror of
https://github.com/motajs/template.git
synced 2026-09-12 09:30:19 +08:00
test(03-17): cover replay registry construction
- Assert direct stable registry construction - Guard against formatter suppressions and duplicate directional classes - Retain deferred movement and pathfinding ordering coverage
This commit is contained in:
parent
df7d1e12c2
commit
4bd6a463d6
@ -139,6 +139,24 @@ describe('replay commands', () => {
|
||||
);
|
||||
});
|
||||
|
||||
// 验证稳定 registry 使用直接构造且不依赖手工 formatter 抑制
|
||||
it('keeps registry construction direct and formatter-normalized', () => {
|
||||
const source = readFileSync(
|
||||
new URL('./commands.ts', import.meta.url),
|
||||
'utf8'
|
||||
);
|
||||
expect(source).not.toContain('prettier-ignore');
|
||||
expect(source).toContain(
|
||||
'command: new ReplayDirectionCommand(state, FaceDirection.Up)'
|
||||
);
|
||||
expect(source).toContain(
|
||||
'command: new ReplayAutoPathfindCommand(state)'
|
||||
);
|
||||
expect(source).toContain('command: new ReplayUseItemCommand(state)');
|
||||
expect(source).toContain('command: new ReplayEquipCommand(state)');
|
||||
expect(source).toContain('command: new ReplayUnequipCommand(state)');
|
||||
});
|
||||
|
||||
// 验证四向移动等待 controller.onEnd 后才完成 command 并进入下一步
|
||||
it('awaits directional movement before the next replay step', async () => {
|
||||
const state = createCoreState();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user