Monsters opening doors
This commit is contained in:
@@ -465,3 +465,16 @@ export function test_mob(game: GameServer, fields: Partial<EntityJson>, x: numbe
|
||||
game.entities.add_entity(mob);
|
||||
return mob;
|
||||
}
|
||||
|
||||
// what console.error got while fn ran
|
||||
export async function errors_during(fn: () => unknown): Promise<string[]> {
|
||||
const errors: string[] = [];
|
||||
const original = console.error;
|
||||
console.error = (...args: unknown[]) => errors.push(args.map(String).join(" "));
|
||||
try {
|
||||
await fn();
|
||||
} finally {
|
||||
console.error = original;
|
||||
}
|
||||
return errors;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user