Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/excaliburjs/Excalibur. 🎮 Your friendly TypeScript 2D game engine for the web 🗡️ excaliburjs.com
excalibur excaliburjs game-development game-engine game-framework gamedev games html5-canvas typescript
Something went wrong. Try again.
TypeScript
1234567891011121314151617181920212223242526// this is in a separate file because this is executed in the browserimport * as ex from '@excalibur';
/** * Logs the data needed for the engine instance reporter. Should * be run once in setup file. */export function setupEngineInstanceReporter() { let currentEngines = ex.Engine.InstanceCount;
afterEach((ctx) => { ctx.task.meta.engineInstanceLeaks ??= [];
if (currentEngines < ex.Engine.InstanceCount) { // eslint-disable-next-line no-console console.log(`Spec ${ctx.task.name} Engine increased: ${ex.Engine.InstanceCount}`);
ctx.task.meta.engineInstanceLeaks.push({ testName: ctx.task.name, engineCount: ex.Engine.InstanceCount }); } currentEngines = ex.Engine.InstanceCount; });}