Implement scene-based chapter quest progression
Some checks failed
CI / verify (push) Has been cancelled
Some checks failed
CI / verify (push) Has been cancelled
This commit is contained in:
@@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user