Implement scene-based chapter quest progression
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
2026-04-08 11:58:47 +08:00
parent 9d2fc9e4b8
commit bd9fdcbe31
170 changed files with 18259 additions and 1049 deletions

View File

@@ -67,11 +67,15 @@ function createGameState(): GameState {
}
describe('hostileNpcPresets', () => {
it('combines preset loot with runtime semantic drops', () => {
it('combines preset loot with runtime semantic drops', async () => {
const randomSpy = vi.spyOn(Math, 'random').mockReturnValue(0);
vi.stubGlobal(
'fetch',
vi.fn().mockRejectedValue(new TypeError('network disabled in test')),
);
try {
const loot = rollHostileNpcLoot(createGameState(), [
const loot = await rollHostileNpcLoot(createGameState(), [
{
id: 'monster-03',
name: '断骨祟灵',
@@ -82,7 +86,11 @@ describe('hostileNpcPresets', () => {
expect(
loot.some(item => item.runtimeMetadata?.generationChannel === 'monster_drop'),
).toBe(true);
expect(
loot.find(item => item.id === 'monster-loot:bone-dust')?.runtimeMetadata?.storyFingerprint,
).toBeTruthy();
} finally {
vi.unstubAllGlobals();
randomSpy.mockRestore();
}
});