Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Commit

Permalink
fix(specs): reduce amount of DOM nodes in heavy specs
Browse files Browse the repository at this point in the history
Remove no-++ rule.
  • Loading branch information
kasperlewau committed Jan 6, 2016
1 parent 36ca4a5 commit a139948
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Expand Up @@ -47,7 +47,7 @@
"no-iterator": 2,
"no-loop-func": 2,
"no-multi-str": 2,
"no-plusplus": 2,
"no-plusplus": 0,
"no-proto": 2,
"no-script-url": 2,
"no-sequences": 2,
Expand Down
11 changes: 6 additions & 5 deletions test/bindNotifier.spec.js
Expand Up @@ -186,7 +186,7 @@

var list = [];

for (var i = 0; i < 200000; i++) {
for (var i = 0; i < 100000; i++) {
list.push({ id: i });
}

Expand All @@ -196,14 +196,14 @@

$scope.items = list;

function run () {
function slowRun () {
dom = $compile(dom)($scope);
$scope.$digest();
rebindAndDigest($scope, 2);
done();
}

expect(run).to.not.throw();
expect(slowRun).to.not.throw();
});

function expectBothSingleAndMultiple (expression) {
Expand All @@ -229,16 +229,17 @@
}

function getWatchers(root) {
root = angular.element(root || document.documentElement);
var watcherCount = 0;
root = angular.element(root);

function getElemWatchers(element) {
var isolateWatchers = getWatchersFromScope(element.data().$isolateScope);
var scopeWatchers = getWatchersFromScope(element.data().$scope);
var watchers = scopeWatchers.concat(isolateWatchers);

angular.forEach(element.children(), function (childElement) {
watchers = watchers.concat(getElemWatchers(angular.element(childElement)));
});

return watchers;
}

Expand Down

0 comments on commit a139948

Please sign in to comment.