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) {
assert: function (after, initial) {
var nodeIncrease = (after.nodes - initial.nodes);
var listenerIncrease = (after.jsEventListeners - initial.jsEventListeners);
var memoryExceptions = exceptions[framework.name] || {};
console.log(this + ', ' + nodeIncrease + ', ' +
(after.jsHeapSizeUsed - initial.jsHeapSizeUsed) + ', ' + listenerIncrease);
//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!');
}
if (listenerIncrease > exceptions[framework.name].listeners || 0) {
if (listenerIncrease > memoryExceptions.listeners || 0) {
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