@angular/upgrade 20.0.0-next.0 → 20.0.0-next.2

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.
@@ -1,43 +1,39 @@
1
1
  /**
2
- * @license Angular v20.0.0-next.0
3
- * (c) 2010-2024 Google LLC. https://angular.io/
2
+ * @license Angular v20.0.0-next.2
3
+ * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
-
8
7
  import { Type } from '@angular/core';
9
8
 
10
-
11
9
  /**
12
- * A helper function to use when unit testing AngularJS services that depend upon downgraded Angular
10
+ * A helper function to use when unit testing Angular services that depend upon upgraded AngularJS
13
11
  * services.
14
12
  *
15
- * This function returns an AngularJS module that is configured to wire up the AngularJS and Angular
16
- * injectors without the need to actually bootstrap a hybrid application.
13
+ * This function returns an `NgModule` decorated class that is configured to wire up the Angular
14
+ * and AngularJS injectors without the need to actually bootstrap a hybrid application.
17
15
  * This makes it simpler and faster to unit test services.
18
16
  *
19
- * Use the returned AngularJS module in a call to
20
- * [`angular.mocks.module`](https://docs.angularjs.org/api/ngMock/function/angular.mock.module) to
21
- * include this module in the unit test injector.
17
+ * Use the returned class as an "import" when configuring the `TestBed`.
22
18
  *
23
- * In the following code snippet, we are configuring the `$injector` with two modules:
24
- * The AngularJS `ng1AppModule`, which is the AngularJS part of our hybrid application and the
25
- * `Ng2AppModule`, which is the Angular part.
19
+ * In the following code snippet, we are configuring the TestBed with two imports.
20
+ * The `Ng2AppModule` is the Angular part of our hybrid application and the `ng1AppModule` is the
21
+ * AngularJS part.
26
22
  *
27
- * {@example upgrade/static/ts/full/module.spec.ts region='angularjs-setup'}
23
+ * {@example upgrade/static/ts/full/module.spec.ts region='angular-setup'}
28
24
  *
29
- * Once this is done we can get hold of services via the AngularJS `$injector` as normal.
30
- * Services that are (or have dependencies on) a downgraded Angular service, will be instantiated as
31
- * needed by the Angular root `Injector`.
25
+ * Once this is done we can get hold of services via the Angular `Injector` as normal.
26
+ * Services that are (or have dependencies on) an upgraded AngularJS service, will be instantiated
27
+ * as needed by the AngularJS `$injector`.
32
28
  *
33
- * In the following code snippet, `heroesService` is a downgraded Angular service that we are
34
- * accessing from AngularJS.
29
+ * In the following code snippet, `HeroesService` is an Angular service that depends upon an
30
+ * AngularJS service, `titleCase`.
35
31
  *
36
- * {@example upgrade/static/ts/full/module.spec.ts region='angularjs-spec'}
32
+ * {@example upgrade/static/ts/full/module.spec.ts region='angular-spec'}
37
33
  *
38
34
  * <div class="docs-alert docs-alert-important">
39
35
  *
40
- * This helper is for testing services not components.
36
+ * This helper is for testing services not Components.
41
37
  * For Component testing you must still bootstrap a hybrid app. See `UpgradeModule` or
42
38
  * `downgradeModule` for more information.
43
39
  *
@@ -56,7 +52,7 @@ import { Type } from '@angular/core';
56
52
  * The helper sets up global variables to hold the shared Angular and AngularJS injectors.
57
53
  *
58
54
  * * Only call this helper once per spec.
59
- * * Do not use `createAngularJSTestingModule` in the same spec as `createAngularTestingModule`.
55
+ * * Do not use `createAngularTestingModule` in the same spec as `createAngularJSTestingModule`.
60
56
  *
61
57
  * </div>
62
58
  *
@@ -69,40 +65,44 @@ import { Type } from '@angular/core';
69
65
  * </code-tabs>
70
66
  *
71
67
  *
72
- * @param angularModules a collection of Angular modules to include in the configuration.
68
+ * @param angularJSModules a collection of the names of AngularJS modules to include in the
69
+ * configuration.
70
+ * @param [strictDi] whether the AngularJS injector should have `strictDI` enabled.
73
71
  *
74
72
  * @publicApi
75
73
  */
76
- export declare function createAngularJSTestingModule(angularModules: any[]): string;
74
+ declare function createAngularTestingModule(angularJSModules: string[], strictDi?: boolean): Type<any>;
77
75
 
78
76
  /**
79
- * A helper function to use when unit testing Angular services that depend upon upgraded AngularJS
77
+ * A helper function to use when unit testing AngularJS services that depend upon downgraded Angular
80
78
  * services.
81
79
  *
82
- * This function returns an `NgModule` decorated class that is configured to wire up the Angular
83
- * and AngularJS injectors without the need to actually bootstrap a hybrid application.
80
+ * This function returns an AngularJS module that is configured to wire up the AngularJS and Angular
81
+ * injectors without the need to actually bootstrap a hybrid application.
84
82
  * This makes it simpler and faster to unit test services.
85
83
  *
86
- * Use the returned class as an "import" when configuring the `TestBed`.
84
+ * Use the returned AngularJS module in a call to
85
+ * [`angular.mocks.module`](https://docs.angularjs.org/api/ngMock/function/angular.mock.module) to
86
+ * include this module in the unit test injector.
87
87
  *
88
- * In the following code snippet, we are configuring the TestBed with two imports.
89
- * The `Ng2AppModule` is the Angular part of our hybrid application and the `ng1AppModule` is the
90
- * AngularJS part.
88
+ * In the following code snippet, we are configuring the `$injector` with two modules:
89
+ * The AngularJS `ng1AppModule`, which is the AngularJS part of our hybrid application and the
90
+ * `Ng2AppModule`, which is the Angular part.
91
91
  *
92
- * {@example upgrade/static/ts/full/module.spec.ts region='angular-setup'}
92
+ * {@example upgrade/static/ts/full/module.spec.ts region='angularjs-setup'}
93
93
  *
94
- * Once this is done we can get hold of services via the Angular `Injector` as normal.
95
- * Services that are (or have dependencies on) an upgraded AngularJS service, will be instantiated
96
- * as needed by the AngularJS `$injector`.
94
+ * Once this is done we can get hold of services via the AngularJS `$injector` as normal.
95
+ * Services that are (or have dependencies on) a downgraded Angular service, will be instantiated as
96
+ * needed by the Angular root `Injector`.
97
97
  *
98
- * In the following code snippet, `HeroesService` is an Angular service that depends upon an
99
- * AngularJS service, `titleCase`.
98
+ * In the following code snippet, `heroesService` is a downgraded Angular service that we are
99
+ * accessing from AngularJS.
100
100
  *
101
- * {@example upgrade/static/ts/full/module.spec.ts region='angular-spec'}
101
+ * {@example upgrade/static/ts/full/module.spec.ts region='angularjs-spec'}
102
102
  *
103
103
  * <div class="docs-alert docs-alert-important">
104
104
  *
105
- * This helper is for testing services not Components.
105
+ * This helper is for testing services not components.
106
106
  * For Component testing you must still bootstrap a hybrid app. See `UpgradeModule` or
107
107
  * `downgradeModule` for more information.
108
108
  *
@@ -121,7 +121,7 @@ export declare function createAngularJSTestingModule(angularModules: any[]): str
121
121
  * The helper sets up global variables to hold the shared Angular and AngularJS injectors.
122
122
  *
123
123
  * * Only call this helper once per spec.
124
- * * Do not use `createAngularTestingModule` in the same spec as `createAngularJSTestingModule`.
124
+ * * Do not use `createAngularJSTestingModule` in the same spec as `createAngularTestingModule`.
125
125
  *
126
126
  * </div>
127
127
  *
@@ -134,12 +134,10 @@ export declare function createAngularJSTestingModule(angularModules: any[]): str
134
134
  * </code-tabs>
135
135
  *
136
136
  *
137
- * @param angularJSModules a collection of the names of AngularJS modules to include in the
138
- * configuration.
139
- * @param [strictDi] whether the AngularJS injector should have `strictDI` enabled.
137
+ * @param angularModules a collection of Angular modules to include in the configuration.
140
138
  *
141
139
  * @publicApi
142
140
  */
143
- export declare function createAngularTestingModule(angularJSModules: string[], strictDi?: boolean): Type<any>;
141
+ declare function createAngularJSTestingModule(angularModules: any[]): string;
144
142
 
145
- export { }
143
+ export { createAngularJSTestingModule, createAngularTestingModule };