mirror of
https://github.com/motajs/template.git
synced 2026-10-18 12:40:18 +08:00
test(06): restore suite green after replaySystem wiring change
This commit is contained in:
parent
f74646ab0c
commit
2ff422a682
@ -103,7 +103,9 @@ function createItem(
|
|||||||
function createEnv(): TestEnv {
|
function createEnv(): TestEnv {
|
||||||
const tileStore = new TileStore();
|
const tileStore = new TileStore();
|
||||||
const itemStore = new ItemStore<IHeroAttr, unknown>();
|
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 attribute = new HeroAttribute<IHeroAttr>(createBaseAttr());
|
||||||
const store = new HeroEquipsStore<IHeroAttr>(state);
|
const store = new HeroEquipsStore<IHeroAttr>(state);
|
||||||
const equipment = new HeroEquipment<IHeroAttr>(store, attribute);
|
const equipment = new HeroEquipment<IHeroAttr>(store, attribute);
|
||||||
|
|||||||
@ -62,7 +62,9 @@ function createState(): IDataCommon {
|
|||||||
pass: { onlyEvents: false, inPass: 15, outPass: 15 },
|
pass: { onlyEvents: false, inPass: 15, outPass: 15 },
|
||||||
eventPass: true
|
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 {
|
function createEnv(): TestEnv {
|
||||||
const tileStore = new TileStore();
|
const tileStore = new TileStore();
|
||||||
const itemStore = new ItemStore<IHeroAttr, unknown>();
|
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 {
|
return {
|
||||||
state,
|
state,
|
||||||
tileStore,
|
tileStore,
|
||||||
|
|||||||
@ -44,9 +44,12 @@ afterAll(() => {
|
|||||||
|
|
||||||
/** 构造一个仅含图块与道具存储的公共层假对象 */
|
/** 构造一个仅含图块与道具存储的公共层假对象 */
|
||||||
function createState(): IDataCommon {
|
function createState(): IDataCommon {
|
||||||
|
// 录像系统桩,仅用于满足移动时的 route.add 记录
|
||||||
|
const replaySystem = { route: { add: vi.fn() } };
|
||||||
return {
|
return {
|
||||||
tileStore: new TileStore(),
|
tileStore: new TileStore(),
|
||||||
itemStore: new ItemStore()
|
itemStore: new ItemStore(),
|
||||||
|
replaySystem
|
||||||
} as never;
|
} as never;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import {
|
|||||||
IReplayArray,
|
IReplayArray,
|
||||||
IEnemyAttr,
|
IEnemyAttr,
|
||||||
IHeroAttr,
|
IHeroAttr,
|
||||||
|
ReplayCommandCode,
|
||||||
SaveCompression,
|
SaveCompression,
|
||||||
TileType
|
TileType
|
||||||
} from '@user/data-common';
|
} from '@user/data-common';
|
||||||
@ -20,7 +21,6 @@ import {
|
|||||||
IMapStoreSave
|
IMapStoreSave
|
||||||
} from '@user/data-base';
|
} from '@user/data-base';
|
||||||
import { CoreState, createCoreState } from '../../src/core.ts';
|
import { CoreState, createCoreState } from '../../src/core.ts';
|
||||||
import { ReplayCommandCode } from '../../src/replay/types.ts';
|
|
||||||
|
|
||||||
export interface IClosedLoopLayerSnapshot {
|
export interface IClosedLoopLayerSnapshot {
|
||||||
readonly zIndex: number;
|
readonly zIndex: number;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user