mirror of
https://github.com/liabru/matter-js.git
synced 2024-11-23 09:26:51 -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 overlapTotal = 0;
|
||||
let overlapCount = 0;
|
||||
let i;
|
||||
|
||||
global.gc();
|
||||
if (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();
|
||||
totalMemory += process.memoryUsage().heapUsed;
|
||||
|
||||
|
@ -48,6 +52,10 @@ const runExample = options => {
|
|||
overlapCount += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
err.message = `On example '${options.name}' update ${i}:\n\n ${err.message}`;
|
||||
throw err;
|
||||
}
|
||||
|
||||
resetEnvironment();
|
||||
|
|
Loading…
Reference in a new issue