aboutsummaryrefslogtreecommitdiffstats
path: root/test/ScopeSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/ScopeSpec.js')
-rw-r--r--test/ScopeSpec.js19
1 files changed, 12 insertions, 7 deletions
diff --git a/test/ScopeSpec.js b/test/ScopeSpec.js
index 492396c5..fa41e5a9 100644
--- a/test/ScopeSpec.js
+++ b/test/ScopeSpec.js
@@ -1,7 +1,7 @@
'use strict';
-describe('Scope', function() {
- var root, mockHandler;
+describe('Scope', function(){
+ var root = null, mockHandler = null;
beforeEach(function() {
root = createScope(angular.service, {
@@ -245,8 +245,14 @@ describe('Scope', function() {
var log = '';
root.a = [];
root.b = {};
- root.$watch('a', function() { log +='.';});
- root.$watch('b', function() { log +='!';});
+ root.$watch('a', function(scope, value){
+ log +='.';
+ expect(value).toBe(root.a);
+ });
+ root.$watch('b', function(scope, value){
+ log +='!';
+ expect(value).toBe(root.b);
+ });
root.$digest();
log = '';
@@ -296,8 +302,8 @@ describe('Scope', function() {
});
- describe('$destroy', function() {
- var first, middle, last, log;
+ describe('$destroy', function(){
+ var first = null, middle = null, last = null, log = null;
beforeEach(function() {
log = '';
@@ -531,7 +537,6 @@ describe('Scope', function() {
greatGrandChild.$on('myEvent', logger);
});
-
it('should bubble event up to the root scope', function() {
grandChild.$emit('myEvent');
expect(log).toEqual('2>1>0>');