test(06): restore suite green after replaySystem wiring change

This commit is contained in:
unanmed 2026-09-14 19:16:32 +08:00
parent f74646ab0c
commit 2ff422a682
5 changed files with 14 additions and 5 deletions

View File

@ -103,7 +103,9 @@ function createItem(
function createEnv(): TestEnv {
const tileStore = new TileStore();
const itemStore = new ItemStore<IHeroAttr, unknown>();
const state = { tileStore, itemStore } as never;
// 录像系统桩,仅用于满足装备/卸下时的 route.add 记录
const replaySystem = { route: { add: vi.fn() } };
const state = { tileStore, itemStore, replaySystem } as never;
const attribute = new HeroAttribute<IHeroAttr>(createBaseAttr());
const store = new HeroEquipsStore<IHeroAttr>(state);
const equipment = new HeroEquipment<IHeroAttr>(store, attribute);

View File

@ -62,7 +62,9 @@ function createState(): IDataCommon {
pass: { onlyEvents: false, inPass: 15, outPass: 15 },
eventPass: true
});
return { tileStore, itemStore } as never;
// 录像系统桩,仅用于满足移动时的 route.add 记录
const replaySystem = { route: { add: vi.fn() } };
return { tileStore, itemStore, replaySystem } as never;
}
/** 构造一个停在原点的勇士位置对象 */

View File

@ -58,7 +58,9 @@ interface ItemFixture {
function createEnv(): TestEnv {
const tileStore = new TileStore();
const itemStore = new ItemStore<IHeroAttr, unknown>();
const state = { tileStore, itemStore } as never;
// 录像系统桩,仅用于满足道具使用时的 route.add 记录
const replaySystem = { route: { add: vi.fn() } };
const state = { tileStore, itemStore, replaySystem } as never;
return {
state,
tileStore,

View File

@ -44,9 +44,12 @@ afterAll(() => {
/** 构造一个仅含图块与道具存储的公共层假对象 */
function createState(): IDataCommon {
// 录像系统桩,仅用于满足移动时的 route.add 记录
const replaySystem = { route: { add: vi.fn() } };
return {
tileStore: new TileStore(),
itemStore: new ItemStore()
itemStore: new ItemStore(),
replaySystem
} as never;
}

View File

@ -8,6 +8,7 @@ import {
IReplayArray,
IEnemyAttr,
IHeroAttr,
ReplayCommandCode,
SaveCompression,
TileType
} from '@user/data-common';
@ -20,7 +21,6 @@ import {
IMapStoreSave
} from '@user/data-base';
import { CoreState, createCoreState } from '../../src/core.ts';
import { ReplayCommandCode } from '../../src/replay/types.ts';
export interface IClosedLoopLayerSnapshot {
readonly zIndex: number;