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

This commit is contained in:
AncTe committed 2026-09-14 19:16:32 +08:00
1 parent f74646ab0c
commit 2ff422a682
5 files changed
+14 -5

No files matched your search

@@ -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);
@@ -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;
}
/** 构造一个停在原点的勇士位置对象 */
@@ -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,
@@ -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;
}