Commit 126da65a authored by Sam Saccone's avatar Sam Saccone

tests: handle when there are no exceptions

parent 75b7cce7
...@@ -78,15 +78,17 @@ list.forEach(function (framework) { ...@@ -78,15 +78,17 @@ list.forEach(function (framework) {
assert: function (after, initial) { assert: function (after, initial) {
var nodeIncrease = (after.nodes - initial.nodes); var nodeIncrease = (after.nodes - initial.nodes);
var listenerIncrease = (after.jsEventListeners - initial.jsEventListeners); var listenerIncrease = (after.jsEventListeners - initial.jsEventListeners);
var memoryExceptions = exceptions[framework.name] || {};
console.log(this + ', ' + nodeIncrease + ', ' + console.log(this + ', ' + nodeIncrease + ', ' +
(after.jsHeapSizeUsed - initial.jsHeapSizeUsed) + ', ' + listenerIncrease); (after.jsHeapSizeUsed - initial.jsHeapSizeUsed) + ', ' + listenerIncrease);
//https://code.google.com/p/chromium/issues/detail?id=516153 //https://code.google.com/p/chromium/issues/detail?id=516153
if (nodeIncrease > exceptions[framework.name].nodes || 0) { if (nodeIncrease > memoryExceptions.nodes || 0) {
throw new Error('Node Count leak detected!'); throw new Error('Node Count leak detected!');
} }
if (listenerIncrease > exceptions[framework.name].listeners || 0) { if (listenerIncrease > memoryExceptions.listeners || 0) {
throw new Error('Event Listener leak detected!'); throw new Error('Event Listener leak detected!');
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment