@angular-wave/angular.ts 0.0.38 → 0.0.40
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.
- package/Makefile +8 -5
- package/README.md +1 -1
- package/dist/angular-ts.esm.js +2 -1
- package/dist/angular-ts.umd.js +2 -1
- package/package.json +2 -4
- package/rollup.config.js +11 -2
- package/src/angular.spec.js +25 -26
- package/src/animations/animate-css-driver.js +3 -3
- package/src/animations/animate-queue.js +7 -7
- package/src/animations/animation.js +2 -2
- package/src/animations/shared.js +6 -6
- package/src/binding.spec.js +7 -7
- package/src/core/animate/animate.js +5 -5
- package/src/core/animate/animate.spec.js +31 -31
- package/src/core/cache/cache-factory.html +18 -0
- package/src/core/cache/{cache-factor.test.js → cache-factory.test.js} +1 -1
- package/src/core/compile/compile.js +31 -25
- package/src/core/compile/compile.md +2 -2
- package/src/core/cookie-reader.spec.js +2 -2
- package/src/core/core.html +22 -0
- package/src/core/core.test.js +12 -0
- package/src/core/document.spec.js +4 -4
- package/src/core/exception-handler.js +30 -23
- package/src/core/interpolate/interpolate.js +7 -0
- package/src/core/{cache/cache-factor.html → location/location.html} +1 -1
- package/src/core/location/location.js +2 -2
- package/src/core/location/location.spec.js +17 -17
- package/src/core/location/location.test.js +12 -0
- package/src/core/on.spec.js +3 -3
- package/src/core/parser/parse.html +18 -0
- package/src/core/parser/parse.spec.js +1 -1
- package/src/core/parser/parse.test.js +12 -0
- package/src/core/prop.spec.js +3 -4
- package/src/core/pubsub/pubsub.html +18 -0
- package/src/core/pubsub/pubsub.spec.js +1 -1
- package/src/core/pubsub/pubsub.test.js +12 -0
- package/src/core/q/q.html +18 -0
- package/src/core/q/q.js +33 -0
- package/src/core/q/q.test.js +0 -0
- package/src/core/root-element.spec.js +4 -4
- package/src/core/sanitize/sanitize-uri.spec.js +1 -1
- package/src/core/sanitize/sanitize-uri.test.js +12 -0
- package/src/core/sanitize/sanitize.html +21 -0
- package/src/core/sce/sce.html +18 -0
- package/src/core/sce/sce.spec.js +2 -1
- package/src/core/sce/sce.test.js +12 -0
- package/src/core/scope/scope.html +18 -0
- package/src/core/scope/scope.js +5 -8
- package/src/core/scope/scope.spec.js +1 -1
- package/src/core/scope/scope.test.js +12 -0
- package/src/core/task-tracker-factory.js +9 -11
- package/src/core/timeout/timeout.html +18 -0
- package/src/core/timeout/timeout.js +9 -0
- package/src/core/timeout/timeout.spec.js +2 -2
- package/src/core/timeout/timout.test.js +12 -0
- package/src/core/url-utils/url-utils.html +18 -0
- package/src/core/url-utils/url-utils.spec.js +4 -2
- package/src/core/url-utils/url-utils.test.js +12 -0
- package/src/directive/attrs/attrs.spec.js +1 -2
- package/src/directive/attrs/boolean.spec.js +1 -2
- package/src/directive/attrs/element-style.spec.js +6 -7
- package/src/directive/attrs/src.spec.js +1 -2
- package/src/directive/bind/bind.spec.js +1 -2
- package/src/directive/class/class.spec.js +15 -16
- package/src/directive/cloak/cloak.spec.js +3 -4
- package/src/directive/controller/controller.spec.js +4 -5
- package/src/directive/events/click.spec.js +1 -2
- package/src/directive/events/event.spec.js +1 -1
- package/src/directive/events/events.js +7 -0
- package/src/directive/form/form.spec.js +17 -17
- package/src/directive/if/if.spec.js +2 -2
- package/src/directive/include/include.js +2 -2
- package/src/directive/include/include.spec.js +32 -32
- package/src/directive/init/init.spec.js +2 -3
- package/src/directive/input/input.spec.js +3 -3
- package/src/directive/list/list.spec.js +1 -2
- package/src/directive/model/model.js +13 -0
- package/src/directive/model/model.spec.js +4 -5
- package/src/directive/model-options/model-options.spec.js +3 -3
- package/src/directive/non-bindable/non-bindable.spec.js +1 -2
- package/src/directive/options/options.js +5 -5
- package/src/directive/options/options.spec.js +13 -13
- package/src/directive/ref/href.spec.js +1 -2
- package/src/directive/repeat/repeat.spec.js +12 -12
- package/src/directive/script/script.spec.js +2 -3
- package/src/directive/select/select.js +6 -6
- package/src/directive/select/select.spec.js +5 -5
- package/src/directive/show-hide/show-hide.spec.js +12 -13
- package/src/directive/style/style.spec.js +3 -4
- package/src/directive/switch/switch.spec.js +2 -3
- package/src/directive/validators/validators.spec.js +1 -1
- package/src/exts/aria/aria.spec.js +1 -2
- package/src/exts/messages/messages.spec.js +5 -5
- package/src/filters/filter.spec.js +5 -5
- package/src/filters/filters.html +21 -0
- package/src/filters/filters.spec.js +3 -3
- package/src/filters/filters.test.js +12 -0
- package/src/filters/limit-to.md +1 -1
- package/src/filters/limit-to.spec.js +4 -4
- package/src/filters/order-by.spec.js +2 -2
- package/src/index.js +462 -1
- package/src/loader.js +62 -17
- package/src/public.js +6 -2
- package/src/router/directives/state-directives.spec.js +90 -90
- package/src/router/directives/view-directive.js +2 -2
- package/src/router/directives/view-directive.spec.js +9 -9
- package/src/router/state/state.spec.js +2 -4
- package/src/router/template-factory.spec.js +2 -2
- package/src/router/transition/hook-registry.js +2 -2
- package/src/router/view/view.spec.js +1 -1
- package/src/services/browser.js +56 -39
- package/src/services/document.js +16 -13
- package/src/services/log.js +39 -43
- package/src/services/template-request.js +9 -0
- package/src/shared/common.js +0 -3
- package/src/shared/jqlite/jqlite.js +83 -89
- package/src/shared/jqlite/jqlite.spec.js +218 -222
- package/src/shared/strings.js +2 -2
- package/src/shared/test-utils.js +2 -2
- package/src/shared/utils.js +8 -11
- package/src/src.test.js +10 -0
- package/tsconfig.json +1 -1
- package/tsconfig.types.json +11 -0
- package/types/animations/animate-cache.d.ts +7 -7
- package/types/animations/animate-children-directive.d.ts +3 -6
- package/types/animations/animate-swap.d.ts +7 -16
- package/types/animations/animation.d.ts +2 -11
- package/types/animations/raf-scheduler.d.ts +3 -3
- package/types/animations/shared.d.ts +9 -24
- package/types/core/{animate-css.d.ts → animate/animate-css.d.ts} +2 -8
- package/types/core/{cache.d.ts → cache/cache.d.ts} +5 -5
- package/types/core/compile/compile.d.ts +173 -0
- package/types/core/controller/controller.d.ts +32 -0
- package/types/core/exception-handler.d.ts +9 -42
- package/types/core/filter/filter.d.ts +9 -0
- package/types/core/{interpolate.d.ts → interpolate/interpolate.d.ts} +23 -39
- package/types/core/interval/interval-factory.d.ts +4 -0
- package/types/core/{interval.d.ts → interval/interval.d.ts} +1 -1
- package/types/core/location/location.d.ts +209 -0
- package/types/core/pubsub/pubsub.d.ts +156 -0
- package/types/core/q/q.d.ts +65 -0
- package/types/core/sanitize/sanitize-uri.d.ts +53 -0
- package/types/core/{sce.d.ts → sce/sce.d.ts} +80 -86
- package/types/core/scope/scope.d.ts +727 -0
- package/types/core/task-tracker-factory.d.ts +45 -38
- package/types/core/timeout/timeout.d.ts +29 -0
- package/types/core/{urlUtils.d.ts → url-utils/url-utils.d.ts} +2 -7
- package/types/directive/{bind.d.ts → bind/bind.d.ts} +4 -10
- package/types/directive/{class.d.ts → class/class.d.ts} +12 -21
- package/types/directive/controller/controller.d.ts +6 -0
- package/types/directive/events/events.d.ts +5 -0
- package/types/directive/form/form.d.ts +200 -0
- package/types/directive/if/if.d.ts +8 -0
- package/types/directive/include/include.d.ts +14 -0
- package/types/directive/{input.d.ts → input/input.d.ts} +20 -69
- package/types/directive/{model.d.ts → model/model.d.ts} +281 -280
- package/types/directive/options/options.d.ts +9 -0
- package/types/directive/ref/ref.d.ts +5 -0
- package/types/directive/repeat/repeat.d.ts +8 -0
- package/types/directive/{script.d.ts → script/script.d.ts} +5 -8
- package/types/directive/{show-hide.d.ts → show-hide/show-hide.d.ts} +10 -16
- package/types/directive/switch/switch.d.ts +17 -0
- package/types/directive/transclude/transclude.d.ts +4 -0
- package/types/directive/{validators.d.ts → validators/validators.d.ts} +20 -35
- package/types/filters/filters.d.ts +10 -16
- package/types/filters/order-by.d.ts +2 -4
- package/types/index.d.ts +702 -0
- package/types/injector.d.ts +12 -0
- package/types/public.d.ts +5 -0
- package/types/router/common/coreservices.d.ts +2 -2
- package/types/router/common/glob.d.ts +9 -9
- package/types/router/common/queue.d.ts +13 -13
- package/types/router/common/trace.d.ts +43 -43
- package/types/router/directives/view-directive.d.ts +13 -32
- package/types/router/globals.d.ts +20 -20
- package/types/router/hooks/lazy-load.d.ts +2 -11
- package/types/router/hooks/redirect-to.d.ts +1 -4
- package/types/router/hooks/url.d.ts +1 -5
- package/types/router/hooks/views.d.ts +1 -4
- package/types/router/params/param-factory.d.ts +5 -5
- package/types/router/params/param-type.d.ts +35 -35
- package/types/router/params/param-types.d.ts +11 -11
- package/types/router/params/param.d.ts +38 -38
- package/types/router/params/state-params.d.ts +10 -10
- package/types/router/path/path-node.d.ts +34 -34
- package/types/router/path/path-utils.d.ts +73 -77
- package/types/router/resolve/resolvable.d.ts +32 -32
- package/types/router/resolve/resolve-context.d.ts +84 -84
- package/types/router/services.d.ts +4 -9
- package/types/router/state/state-builder.d.ts +27 -27
- package/types/router/state/state-matcher.d.ts +5 -5
- package/types/router/state/state-object.d.ts +58 -58
- package/types/router/state/state-queue-manager.d.ts +10 -16
- package/types/router/state/state-registry.d.ts +100 -107
- package/types/router/state/state-service.d.ts +411 -411
- package/types/router/state/target-state.d.ts +64 -69
- package/types/router/state/views.d.ts +31 -37
- package/types/router/state-filters.d.ts +7 -7
- package/types/router/state-provider.d.ts +105 -105
- package/types/router/template-factory.d.ts +83 -112
- package/types/router/transition/hook-builder.d.ts +25 -25
- package/types/router/transition/hook-registry.d.ts +68 -83
- package/types/router/transition/interface.d.ts +7 -7
- package/types/router/transition/reject-factory.d.ts +34 -34
- package/types/router/transition/transition-event-type.d.ts +9 -18
- package/types/router/transition/transition-hook.d.ts +77 -82
- package/types/router/transition/transition-service.d.ts +82 -99
- package/types/router/transition/transition.d.ts +369 -377
- package/types/router/url/url-config.d.ts +84 -84
- package/types/router/url/url-matcher.d.ts +115 -119
- package/types/router/url/url-rule.d.ts +114 -124
- package/types/router/url/url-rules.d.ts +217 -217
- package/types/router/url/url-service.d.ts +264 -269
- package/types/router/view/view.d.ts +114 -117
- package/types/router/view-scroll.d.ts +2 -2
- package/types/services/anchor-scroll.d.ts +2 -8
- package/types/services/browser.d.ts +157 -135
- package/types/services/cache-factory.d.ts +25 -25
- package/types/services/cookie-reader.d.ts +2 -2
- package/types/services/document.d.ts +13 -9
- package/types/services/http/http.d.ts +145 -0
- package/types/services/{http-backend.d.ts → http-backend/http-backend.d.ts} +3 -35
- package/types/services/log.d.ts +55 -52
- package/types/services/template-request.d.ts +44 -53
- package/types/shared/common.d.ts +4 -20
- package/types/{constants.d.ts → shared/constants.d.ts} +6 -6
- package/types/shared/hof.d.ts +1 -1
- package/types/{jqLite.d.ts → shared/jqlite/jqlite.d.ts} +16 -17
- package/types/shared/test-utils.d.ts +11 -0
- package/types/shared/utils.d.ts +29 -46
- package/types-back/global.d.ts +3 -1
- package/types-back/index.d.ts +3 -296
- package/types/core/compile.d.ts +0 -206
- package/types/core/controller.d.ts +0 -42
- package/types/core/filter.d.ts +0 -9
- package/types/core/interval-factory.d.ts +0 -21
- package/types/core/location.d.ts +0 -234
- package/types/core/pubsub.d.ts +0 -164
- package/types/core/q.d.ts +0 -33
- package/types/core/root-scope.d.ts +0 -754
- package/types/core/sanitize-uri.d.ts +0 -57
- package/types/core/timeout.d.ts +0 -31
- package/types/directive/controller.d.ts +0 -6
- package/types/directive/events.d.ts +0 -12
- package/types/directive/form.d.ts +0 -230
- package/types/directive/if.d.ts +0 -17
- package/types/directive/include.d.ts +0 -33
- package/types/directive/options.d.ts +0 -16
- package/types/directive/ref.d.ts +0 -11
- package/types/directive/repeat.d.ts +0 -23
- package/types/directive/switch.d.ts +0 -23
- package/types/directive/transclude.d.ts +0 -15
- package/types/services/http.d.ts +0 -157
- /package/src/core/cache/{cache-factor.spec.js → cache-factory.spec.js} +0 -0
- /package/types/directive/{attrs.d.ts → attrs/attrs.d.ts} +0 -0
- /package/types/directive/{change.d.ts → change/change.d.ts} +0 -0
- /package/types/directive/{cloak.d.ts → cloak/cloak.d.ts} +0 -0
- /package/types/directive/{init.d.ts → init/init.d.ts} +0 -0
- /package/types/directive/{list.d.ts → list/list.d.ts} +0 -0
- /package/types/directive/{non-bindable.d.ts → non-bindable/non-bindable.d.ts} +0 -0
- /package/types/directive/{style.d.ts → style/style.d.ts} +0 -0
- /package/types/exts/{aria.d.ts → aria/aria.d.ts} +0 -0
- /package/types/exts/{messages.d.ts → messages/messages.d.ts} +0 -0
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
LocationHashbangUrl,
|
|
4
4
|
$LocationProvider,
|
|
5
5
|
LocationHashbangInHtml5Url,
|
|
6
|
-
} from "
|
|
6
|
+
} from "./location";
|
|
7
7
|
import { publishExternalAPI } from "../../public";
|
|
8
8
|
import { createInjector } from "../../injector";
|
|
9
9
|
|
|
@@ -883,7 +883,7 @@ describe("$location", () => {
|
|
|
883
883
|
// $rootScope.$digest();
|
|
884
884
|
// $window.location.href = "http://localhost:9876/?q='";
|
|
885
885
|
// expect(() => {
|
|
886
|
-
//
|
|
886
|
+
// JQLite($window).triggerHandler("popstate");
|
|
887
887
|
// }).not.toThrow();
|
|
888
888
|
// });
|
|
889
889
|
// });
|
|
@@ -939,7 +939,7 @@ describe("$location", () => {
|
|
|
939
939
|
// });
|
|
940
940
|
// });
|
|
941
941
|
|
|
942
|
-
//
|
|
942
|
+
// JQLite($window).triggerHandler("hashchange");
|
|
943
943
|
|
|
944
944
|
// expect($browser.url()).toBe("http://foo.bar/#!/baz/qux");
|
|
945
945
|
// expect($location.absUrl()).toBe("http://foo.bar/#!/baz/qux");
|
|
@@ -1378,7 +1378,7 @@ describe("$location", () => {
|
|
|
1378
1378
|
// $rootScope.$digest(); // allow $location initialization to finish
|
|
1379
1379
|
|
|
1380
1380
|
// $window.location.href = "http://server/app/Home?q='";
|
|
1381
|
-
//
|
|
1381
|
+
// JQLite($window).triggerHandler("popstate");
|
|
1382
1382
|
|
|
1383
1383
|
// expect($location.absUrl()).toEqual("http://server/app/Home?q='");
|
|
1384
1384
|
// expect($location.path()).toEqual("/Home");
|
|
@@ -1756,9 +1756,9 @@ describe("$location", () => {
|
|
|
1756
1756
|
// }
|
|
1757
1757
|
|
|
1758
1758
|
// if (linkHref) {
|
|
1759
|
-
// link =
|
|
1759
|
+
// link = JQLite(`<a href="${linkHref}"${attrs}>${content}</a>`)[0];
|
|
1760
1760
|
// } else {
|
|
1761
|
-
// link =
|
|
1761
|
+
// link = JQLite(`<a ${attrs}>${content}</a>`)[0];
|
|
1762
1762
|
// }
|
|
1763
1763
|
|
|
1764
1764
|
// module(
|
|
@@ -1828,15 +1828,15 @@ describe("$location", () => {
|
|
|
1828
1828
|
// browserTrigger(link, "click");
|
|
1829
1829
|
// expectRewriteTo($browser, "http://host.com/base/");
|
|
1830
1830
|
|
|
1831
|
-
//
|
|
1831
|
+
// JQLite(link).attr("href", "http://host.com/base/foo");
|
|
1832
1832
|
// browserTrigger(link, "click");
|
|
1833
1833
|
// expectRewriteTo($browser, "http://host.com/base/foo");
|
|
1834
1834
|
|
|
1835
|
-
//
|
|
1835
|
+
// JQLite(link).attr("href", "http://host.com/base/");
|
|
1836
1836
|
// browserTrigger(link, "click");
|
|
1837
1837
|
// expectRewriteTo($browser, "http://host.com/base/");
|
|
1838
1838
|
|
|
1839
|
-
//
|
|
1839
|
+
// JQLite(link)
|
|
1840
1840
|
// .attr("href", "http://host.com/base/foo")
|
|
1841
1841
|
// .on("click", (e) => {
|
|
1842
1842
|
// e.preventDefault();
|
|
@@ -2113,7 +2113,7 @@ describe("$location", () => {
|
|
|
2113
2113
|
// }),
|
|
2114
2114
|
// setupRewriteChecks(),
|
|
2115
2115
|
// ($browser) => {
|
|
2116
|
-
// const span =
|
|
2116
|
+
// const span = JQLite(link).find("span");
|
|
2117
2117
|
|
|
2118
2118
|
// browserTrigger(span, "click");
|
|
2119
2119
|
// expectRewriteTo($browser, "http://host.com/base/some/link");
|
|
@@ -2441,12 +2441,12 @@ describe("$location", () => {
|
|
|
2441
2441
|
// });
|
|
2442
2442
|
// inject(($location) => {
|
|
2443
2443
|
// // make IE happy
|
|
2444
|
-
//
|
|
2444
|
+
// JQLite(window.document.body).html(
|
|
2445
2445
|
// '<a href="http://server/test.html">link</a>',
|
|
2446
2446
|
// );
|
|
2447
2447
|
|
|
2448
2448
|
// const event = {
|
|
2449
|
-
// target:
|
|
2449
|
+
// target: JQLite(window.document.body).find("a")[0],
|
|
2450
2450
|
// preventDefault: jasmine.createSpy("preventDefault"),
|
|
2451
2451
|
// isDefaultPrevented: jasmine.createSpy().and.returnValue(false),
|
|
2452
2452
|
// };
|
|
@@ -2481,12 +2481,12 @@ describe("$location", () => {
|
|
|
2481
2481
|
// $location,
|
|
2482
2482
|
// ) => {
|
|
2483
2483
|
// // make IE happy
|
|
2484
|
-
//
|
|
2484
|
+
// JQLite(window.document.body).html(
|
|
2485
2485
|
// '<a href="http://server/index.html#test">link</a>',
|
|
2486
2486
|
// );
|
|
2487
2487
|
|
|
2488
2488
|
// const event = {
|
|
2489
|
-
// target:
|
|
2489
|
+
// target: JQLite(window.document.body).find("a")[0],
|
|
2490
2490
|
// preventDefault: jasmine.createSpy("preventDefault"),
|
|
2491
2491
|
// isDefaultPrevented: jasmine.createSpy().and.returnValue(false),
|
|
2492
2492
|
// };
|
|
@@ -2920,7 +2920,7 @@ describe("$location", () => {
|
|
|
2920
2920
|
// function ($rootElement, $compile, $rootScope) {
|
|
2921
2921
|
// $rootElement.html('<a href="http://server/#!/somePath">link</a>');
|
|
2922
2922
|
// $compile($rootElement)($rootScope);
|
|
2923
|
-
//
|
|
2923
|
+
// JQLite(window.document.body).append($rootElement);
|
|
2924
2924
|
// },
|
|
2925
2925
|
// );
|
|
2926
2926
|
|
|
@@ -2951,7 +2951,7 @@ describe("$location", () => {
|
|
|
2951
2951
|
// return function ($rootElement, $compile, $rootScope) {
|
|
2952
2952
|
// $rootElement.html('<a href="http://server/somePath">link</a>');
|
|
2953
2953
|
// $compile($rootElement)($rootScope);
|
|
2954
|
-
//
|
|
2954
|
+
// JQLite(window.document.body).append($rootElement);
|
|
2955
2955
|
// };
|
|
2956
2956
|
// });
|
|
2957
2957
|
|
|
@@ -3399,7 +3399,7 @@ describe("$location", () => {
|
|
|
3399
3399
|
// const win = {};
|
|
3400
3400
|
// angular.extend(win, window);
|
|
3401
3401
|
// // Ensure `window` is a reference to the mock global object, so that
|
|
3402
|
-
// //
|
|
3402
|
+
// // JQLite does the right thing.
|
|
3403
3403
|
// win.window = win;
|
|
3404
3404
|
// win.history = {
|
|
3405
3405
|
// state: options.state || null,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { test, expect } from "@playwright/test";
|
|
2
|
+
|
|
3
|
+
const TEST_URL = "src/core/location/location.html";
|
|
4
|
+
|
|
5
|
+
test("unit tests contain no errors", async ({ page }) => {
|
|
6
|
+
await page.goto(TEST_URL);
|
|
7
|
+
await page.content();
|
|
8
|
+
await page.waitForTimeout(100);
|
|
9
|
+
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
10
|
+
/0 failures/,
|
|
11
|
+
);
|
|
12
|
+
});
|
package/src/core/on.spec.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { publishExternalAPI } from "
|
|
2
|
-
import { createInjector } from "
|
|
3
|
-
import { valueFn } from "
|
|
1
|
+
import { publishExternalAPI } from "../public";
|
|
2
|
+
import { createInjector } from "../injector";
|
|
3
|
+
import { valueFn } from "../shared/utils";
|
|
4
4
|
|
|
5
5
|
describe("ngOn* event binding", () => {
|
|
6
6
|
let $rootScope, module, injector, $compile;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>AngularTS Test Runner</title>
|
|
6
|
+
|
|
7
|
+
<link rel="shortcut icon" type="image/png" href="/images/favicon.ico" />
|
|
8
|
+
<link rel="stylesheet" href="/jasmine/jasmine-5.1.2/jasmine.css" />
|
|
9
|
+
<script src="/jasmine/jasmine-5.1.2/jasmine.js"></script>
|
|
10
|
+
<script src="/jasmine/jasmine-5.1.2/jasmine-html.js"></script>
|
|
11
|
+
<script src="/jasmine/jasmine-5.1.2/boot0.js"></script>
|
|
12
|
+
<script src="/jasmine/jasmine-5.1.2/boot1.js"></script>
|
|
13
|
+
<script type="module" src="/src/core/parser/parse.spec.js"></script>
|
|
14
|
+
</head>
|
|
15
|
+
<body>
|
|
16
|
+
<div id="dummy"></div>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { test, expect } from "@playwright/test";
|
|
2
|
+
|
|
3
|
+
const TEST_URL = "src/core/parser/parse.html";
|
|
4
|
+
|
|
5
|
+
test("unit tests contain no errors", async ({ page }) => {
|
|
6
|
+
await page.goto(TEST_URL);
|
|
7
|
+
await page.content();
|
|
8
|
+
await page.waitForTimeout(100);
|
|
9
|
+
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
10
|
+
/0 failures/,
|
|
11
|
+
);
|
|
12
|
+
});
|
package/src/core/prop.spec.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { publishExternalAPI } from "
|
|
2
|
-
import { createInjector } from "
|
|
3
|
-
import {
|
|
4
|
-
import { valueFn } from "../../shared/utils";
|
|
1
|
+
import { publishExternalAPI } from "../public";
|
|
2
|
+
import { createInjector } from "../injector";
|
|
3
|
+
import { valueFn } from "../shared/utils";
|
|
5
4
|
|
|
6
5
|
describe("ngProp*", () => {
|
|
7
6
|
let $compile, $rootScope, compileProvider, $sce;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>AngularTS Test Runner</title>
|
|
6
|
+
|
|
7
|
+
<link rel="shortcut icon" type="image/png" href="/images/favicon.ico" />
|
|
8
|
+
<link rel="stylesheet" href="/jasmine/jasmine-5.1.2/jasmine.css" />
|
|
9
|
+
<script src="/jasmine/jasmine-5.1.2/jasmine.js"></script>
|
|
10
|
+
<script src="/jasmine/jasmine-5.1.2/jasmine-html.js"></script>
|
|
11
|
+
<script src="/jasmine/jasmine-5.1.2/boot0.js"></script>
|
|
12
|
+
<script src="/jasmine/jasmine-5.1.2/boot1.js"></script>
|
|
13
|
+
<script type="module" src="/src/core/pubsub/pubsub.spec.js"></script>
|
|
14
|
+
</head>
|
|
15
|
+
<body>
|
|
16
|
+
<div id="dummy"></div>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { test, expect } from "@playwright/test";
|
|
2
|
+
|
|
3
|
+
const TEST_URL = "src/core/pubsub/pubsub.html";
|
|
4
|
+
|
|
5
|
+
test("unit tests contain no errors", async ({ page }) => {
|
|
6
|
+
await page.goto(TEST_URL);
|
|
7
|
+
await page.content();
|
|
8
|
+
await page.waitForTimeout(100);
|
|
9
|
+
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
10
|
+
/0 failures/,
|
|
11
|
+
);
|
|
12
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>AngularTS Test Runner</title>
|
|
6
|
+
|
|
7
|
+
<link rel="shortcut icon" type="image/png" href="/images/favicon.ico" />
|
|
8
|
+
<link rel="stylesheet" href="/jasmine/jasmine-5.1.2/jasmine.css" />
|
|
9
|
+
<script src="/jasmine/jasmine-5.1.2/jasmine.js"></script>
|
|
10
|
+
<script src="/jasmine/jasmine-5.1.2/jasmine-html.js"></script>
|
|
11
|
+
<script src="/jasmine/jasmine-5.1.2/boot0.js"></script>
|
|
12
|
+
<script src="/jasmine/jasmine-5.1.2/boot1.js"></script>
|
|
13
|
+
<script type="module" src="/src/core/q/q.spec.js"></script>
|
|
14
|
+
</head>
|
|
15
|
+
<body>
|
|
16
|
+
<div id="dummy"></div>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
package/src/core/q/q.js
CHANGED
|
@@ -216,6 +216,33 @@
|
|
|
216
216
|
* @returns {Promise} The newly created promise.
|
|
217
217
|
*/
|
|
218
218
|
|
|
219
|
+
/**
|
|
220
|
+
* @template T
|
|
221
|
+
* @typedef {Object} angular.QPromise
|
|
222
|
+
* @property {function(
|
|
223
|
+
* ((value: T) => (PromiseLike<never>|PromiseLike<T>|T))|null,
|
|
224
|
+
* ((reason: any) => (PromiseLike<never>|PromiseLike<T>|T))|null,
|
|
225
|
+
* ((state: any) => any)
|
|
226
|
+
* ): angular.QPromise<T|never>} then - Calls one of the success or error callbacks asynchronously as soon as the result is available.
|
|
227
|
+
* @property {function(
|
|
228
|
+
* ((value: T) => (angular.QPromise<never>|angular.QPromise<T>|T))|null,
|
|
229
|
+
* ((reason: any) => (angular.QPromise<never>|angular.QPromise<never>|never))|null,
|
|
230
|
+
* ((state: any) => any)
|
|
231
|
+
* ): angular.QPromise<T|never>} then - Calls one of the success or error callbacks asynchronously as soon as the result is available.
|
|
232
|
+
* @property {function(((reason: any) => (PromiseLike<never>|PromiseLike<T>|T))|null): angular.QPromise<T>|T} catch - Shorthand for promise.then(null, errorCallback).
|
|
233
|
+
* @property {function(((reason: any) => (angular.QPromise<never>|angular.QPromise<T>|T))|null): angular.QPromise<T>|T} catch - Shorthand for promise.then(null, errorCallback).
|
|
234
|
+
* @property {function(function(): void): angular.QPromise<T>} finally - Allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value.
|
|
235
|
+
*/
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
*@template T
|
|
239
|
+
* @typedef {Object} angular.Deferred
|
|
240
|
+
* @property {function(T|angular.QPromise<T>): void} resolve - Resolves the promise with a value or another promise.
|
|
241
|
+
* @property {function(any): void} reject - Rejects the promise with a reason.
|
|
242
|
+
* @property {function(any): void} notify - Provides a progress notification.
|
|
243
|
+
* @property {angular.QPromise<T>} promise - The promise associated with this deferred object.
|
|
244
|
+
*/
|
|
245
|
+
|
|
219
246
|
import {
|
|
220
247
|
forEach,
|
|
221
248
|
minErr,
|
|
@@ -241,6 +268,12 @@ export function $QProvider() {
|
|
|
241
268
|
this.$get = [
|
|
242
269
|
"$rootScope",
|
|
243
270
|
"$exceptionHandler",
|
|
271
|
+
/**
|
|
272
|
+
*
|
|
273
|
+
* @param {*} $rootScope
|
|
274
|
+
* @param {import('../exception-handler').angular.ErrorHandler} $exceptionHandler
|
|
275
|
+
* @returns
|
|
276
|
+
*/
|
|
244
277
|
function ($rootScope, $exceptionHandler) {
|
|
245
278
|
return qFactory(
|
|
246
279
|
(callback) => {
|
|
File without changes
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Angular } from "
|
|
3
|
-
import { publishExternalAPI } from "
|
|
1
|
+
import { JQLite, dealoc } from "../shared/jqlite/jqlite";
|
|
2
|
+
import { Angular } from "../loader";
|
|
3
|
+
import { publishExternalAPI } from "../public";
|
|
4
4
|
|
|
5
5
|
describe("$rootElement", () => {
|
|
6
6
|
let angular = new Angular();
|
|
7
7
|
publishExternalAPI();
|
|
8
8
|
|
|
9
9
|
it("should publish the bootstrap element into $rootElement", () => {
|
|
10
|
-
const element =
|
|
10
|
+
const element = JQLite("<div></div>");
|
|
11
11
|
const injector = angular.bootstrap(element);
|
|
12
12
|
|
|
13
13
|
expect(injector.get("$rootElement")[0]).toBe(element[0]);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { test, expect } from "@playwright/test";
|
|
2
|
+
|
|
3
|
+
const TEST_URL = "src/core/sanitize/sanitize.html";
|
|
4
|
+
|
|
5
|
+
test("unit tests contain no errors", async ({ page }) => {
|
|
6
|
+
await page.goto(TEST_URL);
|
|
7
|
+
await page.content();
|
|
8
|
+
await page.waitForTimeout(100);
|
|
9
|
+
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
10
|
+
/0 failures/,
|
|
11
|
+
);
|
|
12
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>AngularTS Test Runner</title>
|
|
6
|
+
|
|
7
|
+
<link rel="shortcut icon" type="image/png" href="/images/favicon.ico" />
|
|
8
|
+
<link rel="stylesheet" href="/jasmine/jasmine-5.1.2/jasmine.css" />
|
|
9
|
+
<script src="/jasmine/jasmine-5.1.2/jasmine.js"></script>
|
|
10
|
+
<script src="/jasmine/jasmine-5.1.2/jasmine-html.js"></script>
|
|
11
|
+
<script src="/jasmine/jasmine-5.1.2/boot0.js"></script>
|
|
12
|
+
<script src="/jasmine/jasmine-5.1.2/boot1.js"></script>
|
|
13
|
+
<script
|
|
14
|
+
type="module"
|
|
15
|
+
src="/src/core/sanitize/sanitize-uri.spec.js"
|
|
16
|
+
></script>
|
|
17
|
+
</head>
|
|
18
|
+
<body>
|
|
19
|
+
<div id="dummy"></div>
|
|
20
|
+
</body>
|
|
21
|
+
</html>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>AngularTS Test Runner</title>
|
|
6
|
+
|
|
7
|
+
<link rel="shortcut icon" type="image/png" href="/images/favicon.ico" />
|
|
8
|
+
<link rel="stylesheet" href="/jasmine/jasmine-5.1.2/jasmine.css" />
|
|
9
|
+
<script src="/jasmine/jasmine-5.1.2/jasmine.js"></script>
|
|
10
|
+
<script src="/jasmine/jasmine-5.1.2/jasmine-html.js"></script>
|
|
11
|
+
<script src="/jasmine/jasmine-5.1.2/boot0.js"></script>
|
|
12
|
+
<script src="/jasmine/jasmine-5.1.2/boot1.js"></script>
|
|
13
|
+
<script type="module" src="/src/core/sce/sce.spec.js"></script>
|
|
14
|
+
</head>
|
|
15
|
+
<body>
|
|
16
|
+
<div id="dummy"></div>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
package/src/core/sce/sce.spec.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createInjector } from "../../injector";
|
|
2
2
|
|
|
3
3
|
import { publishExternalAPI } from "../../public";
|
|
4
|
-
import { adjustMatcher } from "
|
|
4
|
+
import { adjustMatcher } from "./sce";
|
|
5
5
|
|
|
6
6
|
describe("SCE", () => {
|
|
7
7
|
let $sce, $rootScope;
|
|
@@ -175,6 +175,7 @@ describe("SCE", () => {
|
|
|
175
175
|
});
|
|
176
176
|
|
|
177
177
|
describe("$sce.parseAs", () => {
|
|
178
|
+
publishExternalAPI();
|
|
178
179
|
beforeEach(function () {
|
|
179
180
|
createInjector(["ng"]).invoke((_$sce_, _$rootScope_) => {
|
|
180
181
|
$sce = _$sce_;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { test, expect } from "@playwright/test";
|
|
2
|
+
|
|
3
|
+
const TEST_URL = "src/core/sce/sce.html";
|
|
4
|
+
|
|
5
|
+
test("unit tests contain no errors", async ({ page }) => {
|
|
6
|
+
await page.goto(TEST_URL);
|
|
7
|
+
await page.content();
|
|
8
|
+
await page.waitForTimeout(100);
|
|
9
|
+
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
10
|
+
/0 failures/,
|
|
11
|
+
);
|
|
12
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>AngularTS Test Runner</title>
|
|
6
|
+
|
|
7
|
+
<link rel="shortcut icon" type="image/png" href="/images/favicon.ico" />
|
|
8
|
+
<link rel="stylesheet" href="/jasmine/jasmine-5.1.2/jasmine.css" />
|
|
9
|
+
<script src="/jasmine/jasmine-5.1.2/jasmine.js"></script>
|
|
10
|
+
<script src="/jasmine/jasmine-5.1.2/jasmine-html.js"></script>
|
|
11
|
+
<script src="/jasmine/jasmine-5.1.2/boot0.js"></script>
|
|
12
|
+
<script src="/jasmine/jasmine-5.1.2/boot1.js"></script>
|
|
13
|
+
<script type="module" src="/src/core/scope/scope.spec.js"></script>
|
|
14
|
+
</head>
|
|
15
|
+
<body>
|
|
16
|
+
<div id="dummy"></div>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
package/src/core/scope/scope.js
CHANGED
|
@@ -53,9 +53,9 @@ let applyAsyncId = null;
|
|
|
53
53
|
/** Services required by each scope instance */
|
|
54
54
|
/** @type {angular.IParseService} */
|
|
55
55
|
let $parse;
|
|
56
|
-
/** @type {import('
|
|
56
|
+
/** @type {import('../../services/browser').Browser} */
|
|
57
57
|
let $browser;
|
|
58
|
-
|
|
58
|
+
/**@type {import('../exception-handler').angular.ErrorHandler} */
|
|
59
59
|
let $exceptionHandler;
|
|
60
60
|
|
|
61
61
|
/**
|
|
@@ -123,10 +123,7 @@ export class $RootScopeProvider {
|
|
|
123
123
|
* to construct.
|
|
124
124
|
*/
|
|
125
125
|
|
|
126
|
-
|
|
127
|
-
* @type {angular.Scope}
|
|
128
|
-
*/
|
|
129
|
-
class Scope {
|
|
126
|
+
export class Scope {
|
|
130
127
|
constructor() {
|
|
131
128
|
/**
|
|
132
129
|
* @type {number} Unique scope ID (monotonically increasing) useful for debugging.
|
|
@@ -142,7 +139,7 @@ class Scope {
|
|
|
142
139
|
this.$parent = null;
|
|
143
140
|
|
|
144
141
|
/**
|
|
145
|
-
* @type {?
|
|
142
|
+
* @type {?Scope}
|
|
146
143
|
*/
|
|
147
144
|
this.$root = this;
|
|
148
145
|
|
|
@@ -377,7 +374,7 @@ class Scope {
|
|
|
377
374
|
*
|
|
378
375
|
* - `string`: Evaluated as {@link guide/expression expression}
|
|
379
376
|
* - `function(scope)`: called with current `scope` as a parameter.
|
|
380
|
-
* @param {(newVal: any, oldVal: any, scope:
|
|
377
|
+
* @param {(newVal: any, oldVal: any, scope: Scope) => any} listener Callback called whenever the value
|
|
381
378
|
* of `watchExpression` changes.
|
|
382
379
|
*
|
|
383
380
|
* - `newVal` contains the current value of the `watchExpression`
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { test, expect } from "@playwright/test";
|
|
2
|
+
|
|
3
|
+
const TEST_URL = "src/core/scope/scope.html";
|
|
4
|
+
|
|
5
|
+
test("unit tests contain no errors", async ({ page }) => {
|
|
6
|
+
await page.goto(TEST_URL);
|
|
7
|
+
await page.content();
|
|
8
|
+
await page.waitForTimeout(100);
|
|
9
|
+
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
10
|
+
/0 failures/,
|
|
11
|
+
);
|
|
12
|
+
});
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
export function $$TaskTrackerFactoryProvider() {
|
|
2
|
+
// eslint-disable-next-line no-use-before-define
|
|
3
|
+
this.$get = [
|
|
4
|
+
"$log",
|
|
5
|
+
/** @param {import('../services/log').angular.LogService} log */
|
|
6
|
+
(log) => new TaskTracker(log),
|
|
7
|
+
];
|
|
8
|
+
}
|
|
2
9
|
|
|
3
10
|
/**
|
|
4
11
|
* ! This is a private undocumented service !
|
|
@@ -9,17 +16,8 @@ import { valueFn } from "../shared/utils";
|
|
|
9
16
|
*
|
|
10
17
|
* A `TaskTracker` can keep track of pending tasks (grouped by type) and can notify interested
|
|
11
18
|
* parties when all pending tasks (or tasks of a specific type) have been completed.
|
|
12
|
-
*
|
|
13
|
-
* @param {$log} log - A logger instance (such as `$log`). Used to log error during callback
|
|
14
|
-
* execution.
|
|
15
|
-
*
|
|
16
|
-
*
|
|
19
|
+
* @param {import('../services/log').angular.LogService} log
|
|
17
20
|
*/
|
|
18
|
-
export function $$TaskTrackerFactoryProvider() {
|
|
19
|
-
// eslint-disable-next-line no-use-before-define
|
|
20
|
-
this.$get = valueFn((log) => new TaskTracker(log));
|
|
21
|
-
}
|
|
22
|
-
|
|
23
21
|
export function TaskTracker(log) {
|
|
24
22
|
const self = this;
|
|
25
23
|
const taskCounts = {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>AngularTS Test Runner</title>
|
|
6
|
+
|
|
7
|
+
<link rel="shortcut icon" type="image/png" href="/images/favicon.ico" />
|
|
8
|
+
<link rel="stylesheet" href="/jasmine/jasmine-5.1.2/jasmine.css" />
|
|
9
|
+
<script src="/jasmine/jasmine-5.1.2/jasmine.js"></script>
|
|
10
|
+
<script src="/jasmine/jasmine-5.1.2/jasmine-html.js"></script>
|
|
11
|
+
<script src="/jasmine/jasmine-5.1.2/boot0.js"></script>
|
|
12
|
+
<script src="/jasmine/jasmine-5.1.2/boot1.js"></script>
|
|
13
|
+
<script type="module" src="/src/core/timeout/timeout.spec.js"></script>
|
|
14
|
+
</head>
|
|
15
|
+
<body>
|
|
16
|
+
<div id="dummy"></div>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -3,6 +3,15 @@ import { isDefined, isFunction, minErr, sliceArgs } from "../../shared/utils";
|
|
|
3
3
|
|
|
4
4
|
const $timeoutMinErr = minErr("$timeout");
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @param {*} $rootScope
|
|
9
|
+
* @param {*} $browser
|
|
10
|
+
* @param {*} $q
|
|
11
|
+
* @param {*} $$q
|
|
12
|
+
* @param {import('../exception-handler').angular.ErrorHandler} $exceptionHandler
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
6
15
|
export function $timeout($rootScope, $browser, $q, $$q, $exceptionHandler) {
|
|
7
16
|
const deferreds = {};
|
|
8
17
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { publishExternalAPI } from "../../public";
|
|
2
2
|
import { createInjector } from "../../injector";
|
|
3
|
-
import { wait } from "
|
|
3
|
+
import { wait } from "../../shared/test-utils";
|
|
4
4
|
|
|
5
5
|
describe("$timeout", () => {
|
|
6
6
|
let injector;
|
|
@@ -326,7 +326,7 @@ describe("$timeout", () => {
|
|
|
326
326
|
|
|
327
327
|
it("should forget references to relevant deferred", () => {
|
|
328
328
|
// $browser.cancel is only called on cancel if the deferred object is still referenced
|
|
329
|
-
const cancelSpy = spyOn($browser
|
|
329
|
+
const cancelSpy = spyOn($browser, "cancel").and.callThrough();
|
|
330
330
|
|
|
331
331
|
const promise = $timeout(() => {}, 0, false);
|
|
332
332
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { test, expect } from "@playwright/test";
|
|
2
|
+
|
|
3
|
+
const TEST_URL = "src/core/interval/interval.html";
|
|
4
|
+
|
|
5
|
+
test("unit tests contain no errors", async ({ page }) => {
|
|
6
|
+
await page.goto(TEST_URL);
|
|
7
|
+
await page.content();
|
|
8
|
+
await page.waitForTimeout(100);
|
|
9
|
+
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
10
|
+
/0 failures/,
|
|
11
|
+
);
|
|
12
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>AngularTS Test Runner</title>
|
|
6
|
+
|
|
7
|
+
<link rel="shortcut icon" type="image/png" href="/images/favicon.ico" />
|
|
8
|
+
<link rel="stylesheet" href="/jasmine/jasmine-5.1.2/jasmine.css" />
|
|
9
|
+
<script src="/jasmine/jasmine-5.1.2/jasmine.js"></script>
|
|
10
|
+
<script src="/jasmine/jasmine-5.1.2/jasmine-html.js"></script>
|
|
11
|
+
<script src="/jasmine/jasmine-5.1.2/boot0.js"></script>
|
|
12
|
+
<script src="/jasmine/jasmine-5.1.2/boot1.js"></script>
|
|
13
|
+
<script type="module" src="/src/core/url-utils/url-utils.spec.js"></script>
|
|
14
|
+
</head>
|
|
15
|
+
<body>
|
|
16
|
+
<div id="dummy"></div>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|