@angular-wave/angular.ts 0.4.4 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/dist/angular-ts.esm.js +2 -2
  2. package/dist/angular-ts.umd.js +2 -12
  3. package/index.html +3 -74
  4. package/package.json +1 -1
  5. package/src/angular.spec.js +5 -0
  6. package/src/animations/animate-css.js +13 -5
  7. package/src/animations/animate-queue.js +21 -22
  8. package/src/animations/animate-runner.js +8 -4
  9. package/src/animations/animate.md +1 -1
  10. package/src/animations/animate.spec.js +21 -0
  11. package/src/animations/animation.js +1 -1
  12. package/src/binding.spec.js +1 -0
  13. package/src/core/compile/compile.js +26 -25
  14. package/src/core/compile/compile.spec.js +266 -17
  15. package/src/core/controller/controller.js +0 -2
  16. package/src/core/di/injector.md +1 -1
  17. package/src/core/di/injector.spec.js +2 -0
  18. package/src/core/di/internal-injector.js +1 -2
  19. package/src/core/interpolate/interpolate.js +3 -16
  20. package/src/core/interpolate/interpolate.spec.js +16 -70
  21. package/src/core/interval/interval-factory.js +50 -0
  22. package/src/core/interval/interval.html +18 -0
  23. package/src/core/interval/interval.js +77 -0
  24. package/src/core/interval/interval.md +123 -0
  25. package/src/core/interval/interval.spec.js +280 -0
  26. package/src/core/interval/interval.test.js +1 -1
  27. package/src/core/location/location.js +47 -39
  28. package/src/core/location/location.spec.js +27 -27
  29. package/src/core/on.spec.js +7 -0
  30. package/src/core/parse/interpreter.js +7 -10
  31. package/src/core/parse/parse.js +5 -26
  32. package/src/core/parse/parse.spec.js +91 -95
  33. package/src/core/prop.spec.js +60 -4
  34. package/src/core/q/q.html +18 -0
  35. package/src/core/q/q.js +472 -0
  36. package/src/core/q/q.md +211 -0
  37. package/src/core/q/q.spec.js +2748 -0
  38. package/src/core/q/q.test.js +12 -0
  39. package/src/core/sce/sce.spec.js +8 -0
  40. package/src/core/{model/model.html → scope/scope.html} +1 -1
  41. package/src/core/scope/scope.js +16 -15
  42. package/src/core/scope/scope.spec.js +1959 -24
  43. package/src/core/scope/scope.test.js +12 -0
  44. package/src/core/timeout/timeout.html +18 -0
  45. package/src/core/timeout/timeout.js +109 -0
  46. package/src/core/timeout/timeout.spec.js +354 -0
  47. package/src/core/timeout/timout.test.js +12 -0
  48. package/src/core/url-utils/url-utils.spec.js +1 -1
  49. package/src/directive/aria/aria.js +6 -3
  50. package/src/directive/aria/aria.spec.js +87 -0
  51. package/src/directive/attrs/attrs.spec.js +5 -0
  52. package/src/directive/attrs/boolean.spec.js +15 -0
  53. package/src/directive/attrs/element-style.spec.js +8 -0
  54. package/src/directive/attrs/src.spec.js +7 -0
  55. package/src/directive/bind/bind.spec.js +33 -0
  56. package/src/directive/bind/bing-html.spec.js +3 -0
  57. package/src/directive/class/class.js +3 -3
  58. package/src/directive/class/class.spec.js +75 -9
  59. package/src/directive/controller/controller.spec.js +13 -0
  60. package/src/directive/events/click.spec.js +3 -0
  61. package/src/directive/events/event.spec.js +6 -0
  62. package/src/directive/form/form.js +3 -2
  63. package/src/directive/form/form.spec.js +65 -0
  64. package/src/directive/if/if.spec.js +4 -0
  65. package/src/directive/include/include.spec.js +59 -8
  66. package/src/directive/init/init.js +2 -6
  67. package/src/directive/init/init.spec.js +2 -0
  68. package/src/directive/input/input.spec.js +136 -0
  69. package/src/directive/messages/messages.spec.js +35 -4
  70. package/src/directive/model/model.js +25 -18
  71. package/src/directive/model/model.spec.js +49 -2
  72. package/src/directive/model-options/model-options.spec.js +6 -0
  73. package/src/directive/non-bindable/non-bindable.spec.js +1 -0
  74. package/src/directive/observe/observe.js +1 -0
  75. package/src/directive/observe/observe.spec.js +1 -0
  76. package/src/directive/options/options.spec.js +34 -0
  77. package/src/directive/ref/href.spec.js +15 -0
  78. package/src/directive/repeat/repeat.spec.js +135 -8
  79. package/src/directive/script/script.spec.js +2 -0
  80. package/src/directive/select/select.js +3 -3
  81. package/src/directive/select/select.spec.js +96 -0
  82. package/src/directive/show-hide/show-hide.js +2 -2
  83. package/src/directive/show-hide/show-hide.spec.js +19 -8
  84. package/src/directive/style/style.spec.js +7 -0
  85. package/src/directive/switch/switch.spec.js +5 -5
  86. package/src/directive/validators/validators.spec.js +1 -0
  87. package/src/loader.js +1 -0
  88. package/src/public.js +10 -2
  89. package/src/router/common/coreservices.js +2 -0
  90. package/src/router/directives/state-directives.js +14 -6
  91. package/src/router/directives/state-directives.spec.js +83 -0
  92. package/src/router/directives/view-directive.js +13 -4
  93. package/src/router/directives/view-directive.spec.js +71 -25
  94. package/src/router/hooks/lazy-load.js +2 -2
  95. package/src/router/hooks/views.js +5 -3
  96. package/src/router/resolve/resolvable.js +6 -3
  97. package/src/router/resolve/resolve-context.js +2 -2
  98. package/src/router/state/state-service.js +4 -4
  99. package/src/router/state/state.spec.js +5 -2
  100. package/src/router/state/state.test.js +1 -1
  101. package/src/router/state/views.js +10 -7
  102. package/src/router/template-factory.js +6 -3
  103. package/src/router/template-factory.spec.js +4 -0
  104. package/src/router/transition/transition-hook.js +1 -1
  105. package/src/router/transition/transition.js +1 -1
  106. package/src/router/view-hook.spec.js +2 -2
  107. package/src/router/view-scroll.js +6 -4
  108. package/src/services/browser.js +5 -8
  109. package/src/services/http/http.js +9 -6
  110. package/src/services/http/http.spec.js +31 -30
  111. package/src/services/http/template-request.spec.js +10 -0
  112. package/src/services/http-backend/http-backend.spec.js +3 -3
  113. package/src/services/template-request.js +4 -2
  114. package/src/shared/common.js +2 -1
  115. package/types/core/location/location.d.ts +36 -31
  116. package/types/core/parse/parse.d.ts +0 -26
  117. package/types/core/scope/scope.d.ts +11 -11
  118. package/src/core/model/model.js +0 -944
  119. package/src/core/model/model.spec.js +0 -3012
  120. package/types/core/model/model.d.ts +0 -204
@@ -101,6 +101,7 @@ describe("ngOn* event binding", () => {
101
101
  $rootScope,
102
102
  );
103
103
  const cb = ($rootScope.cb = jasmine.createSpy("ng-on cb"));
104
+ $rootScope.$digest();
104
105
  element.triggerHandler("asdf");
105
106
  expect(cb).toHaveBeenCalled();
106
107
  expect(element.attr("asdf")).toBe("foo");
@@ -111,6 +112,7 @@ describe("ngOn* event binding", () => {
111
112
  $rootScope,
112
113
  );
113
114
  const cb = ($rootScope.cb = jasmine.createSpy("ng-on cb"));
115
+ $rootScope.$digest();
114
116
  element.triggerHandler("asdf");
115
117
  expect(cb).toHaveBeenCalled();
116
118
  expect(element.attr("asdf")).toBe("foo");
@@ -121,6 +123,7 @@ describe("ngOn* event binding", () => {
121
123
  $rootScope,
122
124
  );
123
125
  const cb = ($rootScope.cb = jasmine.createSpy("ng-on cb"));
126
+ $rootScope.$digest();
124
127
  element.triggerHandler("asdf");
125
128
  expect(cb).toHaveBeenCalled();
126
129
  expect(element[0].asdf).toBe(123);
@@ -194,6 +197,8 @@ describe("ngOn* event binding", () => {
194
197
  it("should correctly bind to kebab-cased event names", () => {
195
198
  const element = $compile('<span ng-on-foo-bar="cb()"></span>')($rootScope);
196
199
  const cb = ($rootScope.cb = jasmine.createSpy("ng-on cb"));
200
+ $rootScope.$digest();
201
+
197
202
  element.triggerHandler("foobar");
198
203
  element.triggerHandler("fooBar");
199
204
  expect(cb).not.toHaveBeenCalled();
@@ -205,6 +210,8 @@ describe("ngOn* event binding", () => {
205
210
  it("should correctly bind to camelCased event names", () => {
206
211
  const element = $compile('<span ng-on-foo_bar="cb()"></span>')($rootScope);
207
212
  const cb = ($rootScope.cb = jasmine.createSpy("ng-on cb"));
213
+ $rootScope.$digest();
214
+
208
215
  element.triggerHandler("foobar");
209
216
  element.triggerHandler("foo-bar");
210
217
  element.triggerHandler("foo-bar");
@@ -1,4 +1,4 @@
1
- import { isDefined, isFunction, isObject } from "../../shared/utils";
1
+ import { isDefined } from "../../shared/utils";
2
2
  import { ASTType } from "./ast-type";
3
3
 
4
4
  export const PURITY_ABSOLUTE = 1;
@@ -66,7 +66,6 @@ export class ASTInterpreter {
66
66
  if (inputs) {
67
67
  fn.inputs = inputs;
68
68
  }
69
- fn.decoratedNode = decoratedNode;
70
69
  return fn;
71
70
  }
72
71
 
@@ -135,10 +134,9 @@ export class ASTInterpreter {
135
134
  ? function (scope, locals, assign) {
136
135
  const values = [];
137
136
  for (let i = 0; i < args.length; ++i) {
138
- const res = args[i](scope, locals, assign);
139
- values.push(isFunction(res) ? res() : res);
137
+ values.push(args[i](scope, locals, assign));
140
138
  }
141
- const value = () => right.apply(undefined, values);
139
+ const value = right.apply(undefined, values);
142
140
  return context
143
141
  ? { context: undefined, name: undefined, value }
144
142
  : value;
@@ -146,11 +144,10 @@ export class ASTInterpreter {
146
144
  : function (scope, locals, assign) {
147
145
  const rhs = right(scope, locals, assign);
148
146
  let value;
149
- if (rhs.value != null && isFunction(rhs.value)) {
147
+ if (rhs.value != null) {
150
148
  const values = [];
151
149
  for (let i = 0; i < args.length; ++i) {
152
- const res = args[i](scope, locals, assign);
153
- values.push(isFunction(res) ? res() : res);
150
+ values.push(args[i](scope, locals, assign));
154
151
  }
155
152
  value = rhs.value.apply(rhs.context, values);
156
153
  }
@@ -813,8 +810,8 @@ function assignableAST(ast) {
813
810
  }
814
811
 
815
812
  function plusFn(l, r) {
816
- if (typeof l === "undefined" || isObject(l)) return r;
817
- if (typeof r === "undefined" || isObject(r)) return l;
813
+ if (typeof l === "undefined") return r;
814
+ if (typeof r === "undefined") return l;
818
815
  return l + r;
819
816
  }
820
817
 
@@ -9,21 +9,11 @@ import { Parser } from "./parser/parser.js";
9
9
  * @property {boolean} constant - Indicates if the expression is constant.
10
10
  * @property {boolean} [isPure]
11
11
  * @property {boolean} oneTime
12
- * @property {import("./interpreter.js").DecoratedASTNode} decoratedNode
13
12
  * @property {function(import('../scope/scope').Scope, import('../scope/scope').WatchListener, boolean, CompiledExpression, string | ((scope: import('../scope/scope').Scope) => any) | CompiledExpression): any} [$$watchDelegate]
14
13
  * @property {any[]|Function} inputs
15
14
  * @property {function(any, any): any} [assign] - Assigns a value to a context. If value is not provided,
16
15
  */
17
16
 
18
- /**
19
- * @typedef {Object} CompiledExpressionHandlerMap
20
- * @property {boolean} literal - Indicates if the expression is a literal.
21
- * @property {boolean} constant - Indicates if the expression is constant.
22
- * @property {boolean} [isPure]
23
- * @property {boolean} oneTime
24
- * @property {Map<string, Function>} keyMap - property keys to observe
25
- */
26
-
27
17
  /**
28
18
  * @typedef {Function} CompiledExpressionFunction
29
19
  * @param {import('../scope/scope').Scope} context - An object against which any expressions embedded in the strings are evaluated against (typically a scope object).
@@ -133,24 +123,14 @@ export function ParseProvider() {
133
123
  parsedExpression = parsedExpression.$$intercepted;
134
124
  }
135
125
 
136
- let useInputs = false;
126
+ var useInputs = false;
137
127
 
138
- const fn = function interceptedExpression(
139
- scope,
140
- locals,
141
- assign,
142
- inputs,
143
- ) {
144
- const value =
128
+ var fn = function interceptedExpression(scope, locals, assign, inputs) {
129
+ var value =
145
130
  useInputs && inputs
146
131
  ? inputs[0]
147
132
  : parsedExpression(scope, locals, assign, inputs);
148
- // Do not invoke for getters
149
- if (scope.getter) {
150
- return;
151
- }
152
- const res = isFunction(value) ? value() : value;
153
- return interceptorFn(res);
133
+ return interceptorFn(value);
154
134
  };
155
135
 
156
136
  // Maintain references to the interceptor/intercepted
@@ -161,7 +141,6 @@ export function ParseProvider() {
161
141
  fn.literal = parsedExpression.literal;
162
142
  fn.oneTime = parsedExpression.oneTime;
163
143
  fn.constant = parsedExpression.constant;
164
- fn.decoratedNode = parsedExpression.decoratedNode;
165
144
 
166
145
  // Treat the interceptor like filters.
167
146
  // If it is not $stateful then only watch its inputs.
@@ -349,7 +328,7 @@ function oneTimeWatchDelegate(
349
328
  lastValue =
350
329
  useInputs && inputs ? inputs[0] : exp(scope, locals, assign, inputs);
351
330
  if (isDone(lastValue)) {
352
- scope.$postUpdate(unwatchIfDone);
331
+ scope.$$postDigest(unwatchIfDone);
353
332
  }
354
333
  return post(lastValue);
355
334
  }
@@ -10,7 +10,6 @@ import {
10
10
  import { createInjector } from "../di/injector.js";
11
11
  import { ASTType } from "./ast-type.js";
12
12
  import { Angular } from "../../loader.js";
13
- import { wait } from "../../shared/test-utils.js";
14
13
 
15
14
  describe("parser", () => {
16
15
  let $rootScope;
@@ -930,51 +929,52 @@ describe("parser", () => {
930
929
  expect($parse("::foo")).toBe($parse("::foo"));
931
930
  });
932
931
 
933
- it("should not affect calling the parseFn directly", async () => {
934
- $rootScope.$watch("::foo");
932
+ it("should not affect calling the parseFn directly", () => {
933
+ const fn = $parse("::foo");
934
+ $rootScope.$watch(fn);
935
935
 
936
936
  $rootScope.foo = "bar";
937
- expect($rootScope.$$watchersCount).toBe(1);
938
- expect($rootScope.foo).toEqual("bar");
937
+ expect($rootScope.$$watchers.length).toBe(1);
938
+ expect(fn($rootScope)).toEqual("bar");
939
939
 
940
- await wait();
941
- expect($rootScope.$$watchersCount).toBe(0);
942
- expect($rootScope.foo).toEqual("bar");
940
+ $rootScope.$digest();
941
+ expect($rootScope.$$watchers.length).toBe(0);
942
+ expect(fn($rootScope)).toEqual("bar");
943
943
 
944
944
  $rootScope.foo = "man";
945
- await wait();
946
- expect($rootScope.$$watchersCount).toBe(0);
947
- expect($rootScope.foo).toEqual("man");
945
+ $rootScope.$digest();
946
+ expect($rootScope.$$watchers.length).toBe(0);
947
+ expect(fn($rootScope)).toEqual("man");
948
948
 
949
949
  $rootScope.foo = "shell";
950
- await wait();
951
- expect($rootScope.$$watchersCount).toBe(0);
952
- expect($rootScope.foo).toEqual("shell");
950
+ $rootScope.$digest();
951
+ expect($rootScope.$$watchers.length).toBe(0);
952
+ expect(fn($rootScope)).toEqual("shell");
953
953
  });
954
954
 
955
- it("should stay stable once the value defined", async () => {
956
- $rootScope.$watch("::foo", (value, old) => {
955
+ it("should stay stable once the value defined", () => {
956
+ const fn = $parse("::foo");
957
+ $rootScope.$watch(fn, (value, old) => {
957
958
  if (value !== old) logs.push(value);
958
959
  });
959
- expect(logs.length).toEqual(0);
960
960
 
961
- expect($rootScope.$$watchersCount).toBe(1);
961
+ $rootScope.$digest();
962
+ expect($rootScope.$$watchers.length).toBe(1);
962
963
 
963
964
  $rootScope.foo = "bar";
964
- await wait();
965
-
966
- expect($rootScope.$$watchersCount).toBe(0);
965
+ $rootScope.$digest();
966
+ expect($rootScope.$$watchers.length).toBe(0);
967
967
  expect(logs[0]).toEqual("bar");
968
968
 
969
969
  $rootScope.foo = "man";
970
- await wait();
971
-
972
- expect($rootScope.$$watchersCount).toBe(0);
970
+ $rootScope.$digest();
971
+ expect($rootScope.$$watchers.length).toBe(0);
973
972
  expect(logs.length).toEqual(1);
974
973
  });
975
974
 
976
- it("should have a stable value if at the end of a $digest it has a defined value", async () => {
977
- $rootScope.$watch("::foo", (value, old) => {
975
+ it("should have a stable value if at the end of a $digest it has a defined value", () => {
976
+ const fn = $parse("::foo");
977
+ $rootScope.$watch(fn, (value, old) => {
978
978
  if (value !== old) logs.push(value);
979
979
  });
980
980
  $rootScope.$watch("foo", () => {
@@ -984,37 +984,35 @@ describe("parser", () => {
984
984
  });
985
985
 
986
986
  $rootScope.foo = "bar";
987
- await wait();
988
-
989
- expect($rootScope.$$watchersCount).toBe(1);
990
- expect(logs[0]).toEqual("bar");
987
+ $rootScope.$digest();
988
+ expect($rootScope.$$watchers.length).toBe(2);
989
+ expect(logs[0]).toBeUndefined();
991
990
 
992
991
  $rootScope.foo = "man";
993
- await wait();
994
- expect($rootScope.$$watchersCount).toBe(1);
995
- expect(logs[0]).toEqual("bar");
992
+ $rootScope.$digest();
993
+ expect($rootScope.$$watchers.length).toBe(1);
994
+ expect(logs[1]).toEqual("man");
996
995
 
997
996
  $rootScope.foo = "shell";
998
-
999
- await wait();
1000
- expect($rootScope.$$watchersCount).toBe(1);
1001
- expect(logs.length).toEqual(1);
997
+ $rootScope.$digest();
998
+ expect($rootScope.$$watchers.length).toBe(1);
999
+ expect(logs.length).toEqual(2);
1002
1000
  });
1003
1001
 
1004
- it("should not throw if the stable value is `null`", async () => {
1005
- $rootScope.$watch("::foo");
1002
+ it("should not throw if the stable value is `null`", () => {
1003
+ const fn = $parse("::foo");
1004
+ $rootScope.$watch(fn);
1006
1005
  $rootScope.foo = null;
1007
- await wait();
1008
-
1006
+ $rootScope.$digest();
1009
1007
  $rootScope.foo = "foo";
1010
-
1011
- await wait();
1012
- expect($rootScope.foo).toEqual("foo");
1008
+ $rootScope.$digest();
1009
+ expect(fn()).toEqual(undefined);
1013
1010
  });
1014
1011
 
1015
- xit("should invoke a stateless filter", async () => {
1012
+ it("should invoke a stateless filter once when the parsed expression has an interceptor", () => {
1016
1013
  const countFilter = jasmine.createSpy();
1017
- countFilter.and.callThrough();
1014
+ const interceptor = jasmine.createSpy();
1015
+ countFilter.and.returnValue(1);
1018
1016
  createInjector([
1019
1017
  "ng",
1020
1018
  function ($filterProvider) {
@@ -1024,15 +1022,12 @@ describe("parser", () => {
1024
1022
  scope = _$rootScope_;
1025
1023
  $parse = _$parse_;
1026
1024
  });
1027
- scope.count = 0;
1025
+
1028
1026
  scope.foo = function () {
1029
- scope.count++;
1030
- return scope.count;
1027
+ return 1;
1031
1028
  };
1032
- // todo investiage our function stategy
1033
- scope.$watch("::foo() | count");
1034
-
1035
- await wait();
1029
+ scope.$watch($parse(":: foo() | count", interceptor));
1030
+ scope.$digest();
1036
1031
  expect(countFilter.calls.count()).toBe(1);
1037
1032
  });
1038
1033
  });
@@ -1051,34 +1046,38 @@ describe("parser", () => {
1051
1046
  logs = [];
1052
1047
  });
1053
1048
 
1054
- fit("should only become stable when all the properties of an object have defined values", async () => {
1055
- $rootScope.$watch("::{foo: foo, bar: bar}", (value) => {
1056
- logs.push(value);
1057
- });
1049
+ it("should only become stable when all the properties of an object have defined values", () => {
1050
+ const fn = $parse("::{foo: foo, bar: bar}");
1051
+ $rootScope.$watch(
1052
+ fn,
1053
+ (value) => {
1054
+ logs.push(value);
1055
+ },
1056
+ isDeep,
1057
+ );
1058
1058
 
1059
1059
  expect(logs).toEqual([]);
1060
- expect($rootScope.$$watchersCount).toBe(1);
1061
-
1062
- // $rootScope.$digest();
1063
- // expect($rootScope.$$watchersCount).toBe(1);
1064
- // expect(logs[0]).toEqual({ foo: undefined, bar: undefined });
1065
-
1066
- // $rootScope.foo = "foo";
1067
- // await wait();
1068
- // $rootScope.$digest();
1069
- // expect($rootScope.$$watchersCount).toBe(1);
1070
- //expect(logs[0]).toEqual({ foo: undefined, bar: undefined });
1071
-
1072
- // $rootScope.foo = "foobar";
1073
- // $rootScope.bar = "bar";
1074
- // $rootScope.$digest();
1075
- // expect($rootScope.$$watchersCount).toBe(0);
1076
- // expect(logs[2]).toEqual({ foo: "foobar", bar: "bar" });
1077
-
1078
- // $rootScope.foo = "baz";
1079
- // $rootScope.$digest();
1080
- // expect($rootScope.$$watchersCount).toBe(0);
1081
- // expect(logs[3]).toBeUndefined();
1060
+ expect($rootScope.$$watchers.length).toBe(1);
1061
+
1062
+ $rootScope.$digest();
1063
+ expect($rootScope.$$watchers.length).toBe(1);
1064
+ expect(logs[0]).toEqual({ foo: undefined, bar: undefined });
1065
+
1066
+ $rootScope.foo = "foo";
1067
+ $rootScope.$digest();
1068
+ expect($rootScope.$$watchers.length).toBe(1);
1069
+ expect(logs[0]).toEqual({ foo: undefined, bar: undefined });
1070
+
1071
+ $rootScope.foo = "foobar";
1072
+ $rootScope.bar = "bar";
1073
+ $rootScope.$digest();
1074
+ expect($rootScope.$$watchers.length).toBe(0);
1075
+ expect(logs[2]).toEqual({ foo: "foobar", bar: "bar" });
1076
+
1077
+ $rootScope.foo = "baz";
1078
+ $rootScope.$digest();
1079
+ expect($rootScope.$$watchers.length).toBe(0);
1080
+ expect(logs[3]).toBeUndefined();
1082
1081
  });
1083
1082
 
1084
1083
  it("should only become stable when all the elements of an array have defined values", () => {
@@ -1092,26 +1091,26 @@ describe("parser", () => {
1092
1091
  );
1093
1092
 
1094
1093
  expect(logs.length).toEqual(0);
1095
- expect($rootScope.$$watchersCount).toBe(1);
1094
+ expect($rootScope.$$watchers.length).toBe(1);
1096
1095
 
1097
1096
  $rootScope.$digest();
1098
- expect($rootScope.$$watchersCount).toBe(1);
1097
+ expect($rootScope.$$watchers.length).toBe(1);
1099
1098
  expect(logs[0]).toEqual([undefined, undefined]);
1100
1099
 
1101
1100
  $rootScope.foo = "foo";
1102
1101
  $rootScope.$digest();
1103
- expect($rootScope.$$watchersCount).toBe(1);
1102
+ expect($rootScope.$$watchers.length).toBe(1);
1104
1103
  expect(logs[1]).toEqual(["foo", undefined]);
1105
1104
 
1106
1105
  $rootScope.foo = "foobar";
1107
1106
  $rootScope.bar = "bar";
1108
1107
  $rootScope.$digest();
1109
- expect($rootScope.$$watchersCount).toBe(0);
1108
+ expect($rootScope.$$watchers.length).toBe(0);
1110
1109
  expect(logs[2]).toEqual(["foobar", "bar"]);
1111
1110
 
1112
1111
  $rootScope.foo = "baz";
1113
1112
  $rootScope.$digest();
1114
- expect($rootScope.$$watchersCount).toBe(0);
1113
+ expect($rootScope.$$watchers.length).toBe(0);
1115
1114
  expect(logs[3]).toBeUndefined();
1116
1115
  });
1117
1116
 
@@ -1132,18 +1131,18 @@ describe("parser", () => {
1132
1131
 
1133
1132
  $rootScope.foo = "bar";
1134
1133
  $rootScope.$digest();
1135
- expect($rootScope.$$watchersCount).toBe(2);
1134
+ expect($rootScope.$$watchers.length).toBe(2);
1136
1135
  expect(logs[0]).toEqual(["bar"]);
1137
1136
  expect(logs[1]).toEqual([undefined]);
1138
1137
 
1139
1138
  $rootScope.foo = "baz";
1140
1139
  $rootScope.$digest();
1141
- expect($rootScope.$$watchersCount).toBe(1);
1140
+ expect($rootScope.$$watchers.length).toBe(1);
1142
1141
  expect(logs[2]).toEqual(["baz"]);
1143
1142
 
1144
1143
  $rootScope.bar = "qux";
1145
1144
  $rootScope.$digest();
1146
- expect($rootScope.$$watchersCount).toBe(1);
1145
+ expect($rootScope.$$watchers.length).toBe(1);
1147
1146
  expect(logs[3]).toBeUndefined();
1148
1147
  });
1149
1148
  });
@@ -1495,7 +1494,7 @@ describe("parser", () => {
1495
1494
  expect(watcherCalls).toBe(1);
1496
1495
  });
1497
1496
 
1498
- it("should not be reevaluated in literals", async () => {
1497
+ it("should not be reevaluated in literals", () => {
1499
1498
  let filterCalls = 0;
1500
1499
  filterProvider.register(
1501
1500
  "foo",
@@ -1505,21 +1504,18 @@ describe("parser", () => {
1505
1504
  }),
1506
1505
  );
1507
1506
 
1507
+ scope.date = new Date(1234567890123);
1508
+
1508
1509
  let watcherCalls = 0;
1509
1510
  scope.$watch("[(date | foo)]", (input) => {
1510
1511
  watcherCalls++;
1511
1512
  });
1512
1513
 
1513
- scope.date = new Date(1234567890123);
1514
-
1515
- await wait();
1516
-
1514
+ scope.$digest();
1517
1515
  expect(filterCalls).toBe(1);
1518
1516
  expect(watcherCalls).toBe(1);
1519
1517
 
1520
- scope.date = new Date(1234567890124);
1521
-
1522
- await wait();
1518
+ scope.$digest();
1523
1519
  expect(filterCalls).toBe(1);
1524
1520
  expect(watcherCalls).toBe(1);
1525
1521
  });