mirror of
https://github.com/liabru/matter-js.git
synced 2024-11-27 09:50:52 -05:00
improved error messages on tests
This commit is contained in:
parent
039212a56e
commit
9393ecb5b2
1 changed files with 10 additions and 2 deletions
|
@ -23,10 +23,14 @@ const runExample = options => {
|
||||||
let totalDuration = 0;
|
let totalDuration = 0;
|
||||||
let overlapTotal = 0;
|
let overlapTotal = 0;
|
||||||
let overlapCount = 0;
|
let overlapCount = 0;
|
||||||
|
let i;
|
||||||
|
|
||||||
|
if (global.gc) {
|
||||||
global.gc();
|
global.gc();
|
||||||
|
}
|
||||||
|
|
||||||
for (let i = 0; i < options.updates; i += 1) {
|
try {
|
||||||
|
for (i = 0; i < options.updates; i += 1) {
|
||||||
const startTime = process.hrtime();
|
const startTime = process.hrtime();
|
||||||
totalMemory += process.memoryUsage().heapUsed;
|
totalMemory += process.memoryUsage().heapUsed;
|
||||||
|
|
||||||
|
@ -49,6 +53,10 @@ const runExample = options => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (err) {
|
||||||
|
err.message = `On example '${options.name}' update ${i}:\n\n ${err.message}`;
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
|
||||||
resetEnvironment();
|
resetEnvironment();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue