@angular/core 6.0.3 → 6.0.7
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/bundles/core-testing.umd.js +61 -237
- package/bundles/core-testing.umd.js.map +1 -1
- package/bundles/core-testing.umd.min.js +11 -4
- package/bundles/core-testing.umd.min.js.map +1 -1
- package/bundles/core.umd.js +591 -2007
- package/bundles/core.umd.js.map +1 -1
- package/bundles/core.umd.min.js +4 -32
- package/bundles/core.umd.min.js.map +1 -1
- package/core.metadata.json +1 -1
- package/esm2015/core.externs.js +3 -3
- package/esm2015/src/application_init.js +2 -9
- package/esm2015/src/application_module.js +1 -10
- package/esm2015/src/application_ref.js +15 -30
- package/esm2015/src/change_detection/change_detector_ref.js +7 -5
- package/esm2015/src/change_detection/differs/iterable_differs.js +4 -3
- package/esm2015/src/change_detection/differs/keyvalue_differs.js +4 -3
- package/esm2015/src/change_detection/pipe_transform.js +3 -6
- package/esm2015/src/console.js +0 -11
- package/esm2015/src/di/forward_ref.js +8 -6
- package/esm2015/src/di/injectable.js +1 -4
- package/esm2015/src/di/injection_token.js +6 -8
- package/esm2015/src/di/injector.js +5 -10
- package/esm2015/src/di/metadata.js +1 -16
- package/esm2015/src/di/provider.js +47 -138
- package/esm2015/src/di/reflective_errors.js +14 -7
- package/esm2015/src/di/reflective_injector.js +22 -24
- package/esm2015/src/di/reflective_provider.js +11 -12
- package/esm2015/src/error_handler.js +2 -5
- package/esm2015/src/event_emitter.js +6 -3
- package/esm2015/src/i18n/tokens.js +7 -4
- package/esm2015/src/linker/compiler.js +1 -12
- package/esm2015/src/linker/query_list.js +4 -4
- package/esm2015/src/linker/system_js_ng_module_factory_loader.js +3 -10
- package/esm2015/src/linker/view_ref.js +10 -7
- package/esm2015/src/metadata/di.js +10 -16
- package/esm2015/src/metadata/directives.js +111 -33
- package/esm2015/src/metadata/lifecycle_hooks.js +9 -9
- package/esm2015/src/metadata/ng_module.js +19 -11
- package/esm2015/src/render3/node_manipulation.js +2 -3
- package/esm2015/src/render3/view_ref.js +7 -3
- package/esm2015/src/testability/testability.js +2 -16
- package/esm2015/src/version.js +1 -1
- package/esm2015/src/view/ng_module.js +4 -1
- package/esm2015/src/zone/ng_zone.js +2 -1
- package/esm2015/testing/src/fake_async.js +5 -3
- package/esm2015/testing/src/fake_async_fallback.js +5 -3
- package/esm2015/testing/src/logger.js +0 -7
- package/esm2015/testing/src/metadata_override.js +1 -1
- package/esm2015/testing/src/ng_zone_mock.js +0 -7
- package/esm2015/testing/src/test_bed.js +1 -34
- package/esm2015/testing/src/test_compiler.js +1 -12
- package/esm5/index.js +5 -1
- package/esm5/public_api.js +6 -1
- package/esm5/src/application_init.js +3 -5
- package/esm5/src/application_module.js +2 -2
- package/esm5/src/application_ref.js +35 -211
- package/esm5/src/application_tokens.js +1 -1
- package/esm5/src/change_detection/change_detection.js +1 -1
- package/esm5/src/change_detection/change_detection_util.js +7 -72
- package/esm5/src/change_detection/change_detector_ref.js +1 -1
- package/esm5/src/change_detection/constants.js +1 -24
- package/esm5/src/change_detection/differs/default_iterable_differ.js +26 -209
- package/esm5/src/change_detection/differs/default_keyvalue_differ.js +7 -38
- package/esm5/src/change_detection/differs/iterable_differs.js +5 -42
- package/esm5/src/change_detection/differs/keyvalue_differs.js +6 -51
- package/esm5/src/change_detection/pipe_transform.js +1 -1
- package/esm5/src/change_detection.js +6 -1
- package/esm5/src/codegen_private_exports.js +1 -1
- package/esm5/src/console.js +2 -7
- package/esm5/src/core.js +6 -1
- package/esm5/src/core_private_export.js +1 -1
- package/esm5/src/core_render3_private_export.js +2 -1
- package/esm5/src/debug/debug_node.js +3 -15
- package/esm5/src/di/defs.js +1 -1
- package/esm5/src/di/forward_ref.js +7 -6
- package/esm5/src/di/injectable.js +2 -3
- package/esm5/src/di/injection_token.js +5 -83
- package/esm5/src/di/injector.js +13 -27
- package/esm5/src/di/metadata.js +1 -6
- package/esm5/src/di/provider.js +1 -1
- package/esm5/src/di/r3_injector.js +13 -39
- package/esm5/src/di/reflective_errors.js +14 -7
- package/esm5/src/di/reflective_injector.js +19 -265
- package/esm5/src/di/reflective_key.js +4 -45
- package/esm5/src/di/reflective_provider.js +17 -35
- package/esm5/src/di/scope.js +1 -1
- package/esm5/src/di.js +6 -1
- package/esm5/src/error_handler.js +7 -66
- package/esm5/src/errors.js +1 -1
- package/esm5/src/event_emitter.js +4 -95
- package/esm5/src/i18n/tokens.js +9 -49
- package/esm5/src/linker/compiler.js +9 -69
- package/esm5/src/linker/component_factory.js +2 -18
- package/esm5/src/linker/component_factory_resolver.js +1 -1
- package/esm5/src/linker/element_ref.js +2 -32
- package/esm5/src/linker/ng_module_factory.js +3 -25
- package/esm5/src/linker/ng_module_factory_loader.js +2 -10
- package/esm5/src/linker/query_list.js +12 -112
- package/esm5/src/linker/system_js_ng_module_factory_loader.js +4 -16
- package/esm5/src/linker/template_ref.js +2 -26
- package/esm5/src/linker/view_container_ref.js +2 -38
- package/esm5/src/linker/view_ref.js +10 -115
- package/esm5/src/linker.js +2 -1
- package/esm5/src/metadata/di.js +7 -25
- package/esm5/src/metadata/directives.js +111 -20
- package/esm5/src/metadata/lifecycle_hooks.js +1 -1
- package/esm5/src/metadata/ng_module.js +14 -9
- package/esm5/src/metadata/view.js +1 -20
- package/esm5/src/metadata.js +1 -1
- package/esm5/src/platform_core_providers.js +1 -1
- package/esm5/src/profile/profile.js +1 -1
- package/esm5/src/profile/wtf_impl.js +1 -1
- package/esm5/src/reflection/platform_reflection_capabilities.js +1 -1
- package/esm5/src/reflection/reflection.js +1 -1
- package/esm5/src/reflection/reflection_capabilities.js +3 -8
- package/esm5/src/reflection/reflector.js +2 -10
- package/esm5/src/reflection/types.js +1 -1
- package/esm5/src/render/api.js +7 -71
- package/esm5/src/render.js +2 -1
- package/esm5/src/render3/assert.js +1 -1
- package/esm5/src/render3/component.js +6 -5
- package/esm5/src/render3/definition.js +6 -8
- package/esm5/src/render3/di.js +9 -14
- package/esm5/src/render3/errors.js +1 -1
- package/esm5/src/render3/hooks.js +2 -2
- package/esm5/src/render3/index.js +11 -1
- package/esm5/src/render3/instructions.js +52 -38
- package/esm5/src/render3/interfaces/container.js +1 -1
- package/esm5/src/render3/interfaces/definition.js +1 -1
- package/esm5/src/render3/interfaces/injector.js +1 -1
- package/esm5/src/render3/interfaces/node.js +1 -1
- package/esm5/src/render3/interfaces/projection.js +1 -1
- package/esm5/src/render3/interfaces/query.js +1 -1
- package/esm5/src/render3/interfaces/renderer.js +1 -3
- package/esm5/src/render3/interfaces/view.js +1 -1
- package/esm5/src/render3/ng_dev_mode.js +1 -1
- package/esm5/src/render3/node_assert.js +1 -1
- package/esm5/src/render3/node_manipulation.js +12 -15
- package/esm5/src/render3/node_selector_matcher.js +2 -2
- package/esm5/src/render3/pipe.js +1 -1
- package/esm5/src/render3/pure_function.js +1 -1
- package/esm5/src/render3/query.js +11 -59
- package/esm5/src/render3/util.js +1 -1
- package/esm5/src/render3/view_ref.js +15 -345
- package/esm5/src/sanitization/html_sanitizer.js +8 -12
- package/esm5/src/sanitization/inert_body.js +8 -72
- package/esm5/src/sanitization/sanitization.js +1 -1
- package/esm5/src/sanitization/security.js +2 -37
- package/esm5/src/sanitization/style_sanitizer.js +1 -1
- package/esm5/src/sanitization/url_sanitizer.js +1 -1
- package/esm5/src/testability/testability.js +21 -143
- package/esm5/src/type.js +1 -1
- package/esm5/src/util/decorators.js +1 -1
- package/esm5/src/util/lang.js +1 -1
- package/esm5/src/util/property.js +1 -1
- package/esm5/src/util.js +6 -1
- package/esm5/src/version.js +3 -13
- package/esm5/src/view/element.js +7 -7
- package/esm5/src/view/entrypoint.js +1 -1
- package/esm5/src/view/errors.js +1 -1
- package/esm5/src/view/index.js +1 -1
- package/esm5/src/view/ng_content.js +1 -1
- package/esm5/src/view/ng_module.js +4 -1
- package/esm5/src/view/provider.js +12 -12
- package/esm5/src/view/pure_expression.js +1 -1
- package/esm5/src/view/query.js +6 -6
- package/esm5/src/view/refs.js +8 -14
- package/esm5/src/view/services.js +16 -20
- package/esm5/src/view/text.js +1 -1
- package/esm5/src/view/types.js +19 -41
- package/esm5/src/view/util.js +5 -5
- package/esm5/src/view/view.js +4 -6
- package/esm5/src/view/view_attach.js +5 -5
- package/esm5/src/zone/ng_zone.js +22 -257
- package/esm5/src/zone.js +2 -1
- package/esm5/testing/index.js +5 -1
- package/esm5/testing/public_api.js +6 -1
- package/esm5/testing/src/async.js +1 -1
- package/esm5/testing/src/async_fallback.js +1 -1
- package/esm5/testing/src/async_test_completer.js +2 -8
- package/esm5/testing/src/before_each.js +6 -1
- package/esm5/testing/src/component_fixture.js +9 -75
- package/esm5/testing/src/fake_async.js +12 -3
- package/esm5/testing/src/fake_async_fallback.js +5 -3
- package/esm5/testing/src/lang_utils.js +1 -1
- package/esm5/testing/src/logger.js +1 -1
- package/esm5/testing/src/metadata_override.js +1 -1
- package/esm5/testing/src/ng_zone_mock.js +1 -1
- package/esm5/testing/src/private_export_testing.js +1 -1
- package/esm5/testing/src/render3.js +1 -5
- package/esm5/testing/src/test_bed.js +20 -172
- package/esm5/testing/src/test_compiler.js +5 -43
- package/esm5/testing/src/testing.js +6 -1
- package/esm5/testing/src/testing_internal.js +3 -9
- package/fesm2015/core.js +248 -177
- package/fesm2015/core.js.map +1 -1
- package/fesm2015/testing.js +9 -13
- package/fesm2015/testing.js.map +1 -1
- package/fesm5/core.js +591 -2007
- package/fesm5/core.js.map +1 -1
- package/fesm5/testing.js +61 -237
- package/fesm5/testing.js.map +1 -1
- package/package.json +1 -1
- package/src/application_ref.d.ts +7 -8
- package/src/change_detection/change_detector_ref.d.ts +6 -4
- package/src/change_detection/differs/iterable_differs.d.ts +3 -2
- package/src/change_detection/differs/keyvalue_differs.d.ts +3 -2
- package/src/change_detection/pipe_transform.d.ts +2 -5
- package/src/di/forward_ref.d.ts +7 -5
- package/src/di/injectable.d.ts +4 -14
- package/src/di/injection_token.d.ts +5 -7
- package/src/di/injector.d.ts +7 -10
- package/src/di/metadata.d.ts +13 -86
- package/src/di/provider.d.ts +55 -150
- package/src/di/reflective_errors.d.ts +13 -6
- package/src/di/reflective_injector.d.ts +21 -23
- package/src/di/reflective_provider.d.ts +7 -8
- package/src/error_handler.d.ts +1 -4
- package/src/event_emitter.d.ts +3 -0
- package/src/i18n/tokens.d.ts +8 -4
- package/src/linker/query_list.d.ts +2 -2
- package/src/linker/view_ref.d.ts +9 -6
- package/src/metadata/di.d.ts +41 -59
- package/src/metadata/directives.d.ts +410 -460
- package/src/metadata/lifecycle_hooks.d.ts +8 -8
- package/src/metadata/ng_module.d.ts +49 -38
- package/src/render3/view_ref.d.ts +6 -2
- package/src/zone/ng_zone.d.ts +1 -0
- package/testing/src/fake_async.d.ts +4 -2
- package/testing/src/fake_async_fallback.d.ts +4 -2
- package/testing/src/metadata_override.d.ts +3 -3
- package/testing.d.ts +0 -5
- package/testing.metadata.json +1 -1
package/fesm5/testing.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v6.0.
|
|
2
|
+
* @license Angular v6.0.7
|
|
3
3
|
* (c) 2010-2018 Google, Inc. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -192,8 +192,6 @@ var ComponentFixture = /** @class */ (function () {
|
|
|
192
192
|
_this._onMicrotaskEmptySubscription = ngZone.onMicrotaskEmpty.subscribe({
|
|
193
193
|
next: function () {
|
|
194
194
|
if (_this._autoDetect) {
|
|
195
|
-
// Do a change detection run with checkNoChanges set to true to check
|
|
196
|
-
// there are no changes on the second run.
|
|
197
195
|
// Do a change detection run with checkNoChanges set to true to check
|
|
198
196
|
// there are no changes on the second run.
|
|
199
197
|
_this.detectChanges(true);
|
|
@@ -234,13 +232,7 @@ var ComponentFixture = /** @class */ (function () {
|
|
|
234
232
|
/**
|
|
235
233
|
* Trigger a change detection cycle for the component.
|
|
236
234
|
*/
|
|
237
|
-
|
|
238
|
-
* Trigger a change detection cycle for the component.
|
|
239
|
-
*/
|
|
240
|
-
ComponentFixture.prototype.detectChanges = /**
|
|
241
|
-
* Trigger a change detection cycle for the component.
|
|
242
|
-
*/
|
|
243
|
-
function (checkNoChanges) {
|
|
235
|
+
ComponentFixture.prototype.detectChanges = function (checkNoChanges) {
|
|
244
236
|
var _this = this;
|
|
245
237
|
if (checkNoChanges === void 0) { checkNoChanges = true; }
|
|
246
238
|
if (this.ngZone != null) {
|
|
@@ -256,29 +248,13 @@ var ComponentFixture = /** @class */ (function () {
|
|
|
256
248
|
/**
|
|
257
249
|
* Do a change detection run to make sure there were no changes.
|
|
258
250
|
*/
|
|
259
|
-
|
|
260
|
-
* Do a change detection run to make sure there were no changes.
|
|
261
|
-
*/
|
|
262
|
-
ComponentFixture.prototype.checkNoChanges = /**
|
|
263
|
-
* Do a change detection run to make sure there were no changes.
|
|
264
|
-
*/
|
|
265
|
-
function () { this.changeDetectorRef.checkNoChanges(); };
|
|
251
|
+
ComponentFixture.prototype.checkNoChanges = function () { this.changeDetectorRef.checkNoChanges(); };
|
|
266
252
|
/**
|
|
267
253
|
* Set whether the fixture should autodetect changes.
|
|
268
254
|
*
|
|
269
255
|
* Also runs detectChanges once so that any existing change is detected.
|
|
270
256
|
*/
|
|
271
|
-
|
|
272
|
-
* Set whether the fixture should autodetect changes.
|
|
273
|
-
*
|
|
274
|
-
* Also runs detectChanges once so that any existing change is detected.
|
|
275
|
-
*/
|
|
276
|
-
ComponentFixture.prototype.autoDetectChanges = /**
|
|
277
|
-
* Set whether the fixture should autodetect changes.
|
|
278
|
-
*
|
|
279
|
-
* Also runs detectChanges once so that any existing change is detected.
|
|
280
|
-
*/
|
|
281
|
-
function (autoDetect) {
|
|
257
|
+
ComponentFixture.prototype.autoDetectChanges = function (autoDetect) {
|
|
282
258
|
if (autoDetect === void 0) { autoDetect = true; }
|
|
283
259
|
if (this.ngZone == null) {
|
|
284
260
|
throw new Error('Cannot call autoDetectChanges when ComponentFixtureNoNgZone is set');
|
|
@@ -290,34 +266,14 @@ var ComponentFixture = /** @class */ (function () {
|
|
|
290
266
|
* Return whether the fixture is currently stable or has async tasks that have not been completed
|
|
291
267
|
* yet.
|
|
292
268
|
*/
|
|
293
|
-
|
|
294
|
-
* Return whether the fixture is currently stable or has async tasks that have not been completed
|
|
295
|
-
* yet.
|
|
296
|
-
*/
|
|
297
|
-
ComponentFixture.prototype.isStable = /**
|
|
298
|
-
* Return whether the fixture is currently stable or has async tasks that have not been completed
|
|
299
|
-
* yet.
|
|
300
|
-
*/
|
|
301
|
-
function () { return this._isStable && !this.ngZone.hasPendingMacrotasks; };
|
|
269
|
+
ComponentFixture.prototype.isStable = function () { return this._isStable && !this.ngZone.hasPendingMacrotasks; };
|
|
302
270
|
/**
|
|
303
271
|
* Get a promise that resolves when the fixture is stable.
|
|
304
272
|
*
|
|
305
273
|
* This can be used to resume testing after events have triggered asynchronous activity or
|
|
306
274
|
* asynchronous change detection.
|
|
307
275
|
*/
|
|
308
|
-
|
|
309
|
-
* Get a promise that resolves when the fixture is stable.
|
|
310
|
-
*
|
|
311
|
-
* This can be used to resume testing after events have triggered asynchronous activity or
|
|
312
|
-
* asynchronous change detection.
|
|
313
|
-
*/
|
|
314
|
-
ComponentFixture.prototype.whenStable = /**
|
|
315
|
-
* Get a promise that resolves when the fixture is stable.
|
|
316
|
-
*
|
|
317
|
-
* This can be used to resume testing after events have triggered asynchronous activity or
|
|
318
|
-
* asynchronous change detection.
|
|
319
|
-
*/
|
|
320
|
-
function () {
|
|
276
|
+
ComponentFixture.prototype.whenStable = function () {
|
|
321
277
|
var _this = this;
|
|
322
278
|
if (this.isStable()) {
|
|
323
279
|
return Promise.resolve(false);
|
|
@@ -339,13 +295,7 @@ var ComponentFixture = /** @class */ (function () {
|
|
|
339
295
|
/**
|
|
340
296
|
* Get a promise that resolves when the ui state is stable following animations.
|
|
341
297
|
*/
|
|
342
|
-
|
|
343
|
-
* Get a promise that resolves when the ui state is stable following animations.
|
|
344
|
-
*/
|
|
345
|
-
ComponentFixture.prototype.whenRenderingDone = /**
|
|
346
|
-
* Get a promise that resolves when the ui state is stable following animations.
|
|
347
|
-
*/
|
|
348
|
-
function () {
|
|
298
|
+
ComponentFixture.prototype.whenRenderingDone = function () {
|
|
349
299
|
var renderer = this._getRenderer();
|
|
350
300
|
if (renderer && renderer.whenRenderingDone) {
|
|
351
301
|
return renderer.whenRenderingDone();
|
|
@@ -355,13 +305,7 @@ var ComponentFixture = /** @class */ (function () {
|
|
|
355
305
|
/**
|
|
356
306
|
* Trigger component destruction.
|
|
357
307
|
*/
|
|
358
|
-
|
|
359
|
-
* Trigger component destruction.
|
|
360
|
-
*/
|
|
361
|
-
ComponentFixture.prototype.destroy = /**
|
|
362
|
-
* Trigger component destruction.
|
|
363
|
-
*/
|
|
364
|
-
function () {
|
|
308
|
+
ComponentFixture.prototype.destroy = function () {
|
|
365
309
|
if (!this._isDestroyed) {
|
|
366
310
|
this.componentRef.destroy();
|
|
367
311
|
if (this._onUnstableSubscription != null) {
|
|
@@ -425,7 +369,8 @@ var _inFakeAsyncCall = false;
|
|
|
425
369
|
*
|
|
426
370
|
* Can be used to wrap inject() calls.
|
|
427
371
|
*
|
|
428
|
-
*
|
|
372
|
+
* @usageNotes
|
|
373
|
+
* ### Example
|
|
429
374
|
*
|
|
430
375
|
* {@example core/testing/ts/fake_async.ts region='basic'}
|
|
431
376
|
*
|
|
@@ -490,7 +435,8 @@ function _getFakeAsyncZoneSpec() {
|
|
|
490
435
|
* The microtasks queue is drained at the very start of this function and after any timer callback
|
|
491
436
|
* has been executed.
|
|
492
437
|
*
|
|
493
|
-
*
|
|
438
|
+
* @usageNotes
|
|
439
|
+
* ### Example
|
|
494
440
|
*
|
|
495
441
|
* {@example core/testing/ts/fake_async.ts region='basic'}
|
|
496
442
|
*
|
|
@@ -532,6 +478,13 @@ function flushMicrotasksFallback() {
|
|
|
532
478
|
_getFakeAsyncZoneSpec().flushMicrotasks();
|
|
533
479
|
}
|
|
534
480
|
|
|
481
|
+
/**
|
|
482
|
+
* @license
|
|
483
|
+
* Copyright Google Inc. All Rights Reserved.
|
|
484
|
+
*
|
|
485
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
486
|
+
* found in the LICENSE file at https://angular.io/license
|
|
487
|
+
*/
|
|
535
488
|
var _Zone = typeof Zone !== 'undefined' ? Zone : null;
|
|
536
489
|
var fakeAsyncTestModule = _Zone && _Zone[_Zone.__symbol__('fakeAsyncTest')];
|
|
537
490
|
/**
|
|
@@ -557,7 +510,8 @@ function resetFakeAsyncZone() {
|
|
|
557
510
|
*
|
|
558
511
|
* Can be used to wrap inject() calls.
|
|
559
512
|
*
|
|
560
|
-
*
|
|
513
|
+
* @usageNotes
|
|
514
|
+
* ### Example
|
|
561
515
|
*
|
|
562
516
|
* {@example core/testing/ts/fake_async.ts region='basic'}
|
|
563
517
|
*
|
|
@@ -580,7 +534,8 @@ function fakeAsync(fn) {
|
|
|
580
534
|
* The microtasks queue is drained at the very start of this function and after any timer callback
|
|
581
535
|
* has been executed.
|
|
582
536
|
*
|
|
583
|
-
*
|
|
537
|
+
* @usageNotes
|
|
538
|
+
* ### Example
|
|
584
539
|
*
|
|
585
540
|
* {@example core/testing/ts/fake_async.ts region='basic'}
|
|
586
541
|
*
|
|
@@ -709,49 +664,21 @@ var TestingCompiler = /** @class */ (function (_super) {
|
|
|
709
664
|
* Allows to pass the compile summary from AOT compilation to the JIT compiler,
|
|
710
665
|
* so that it can use the code generated by AOT.
|
|
711
666
|
*/
|
|
712
|
-
|
|
713
|
-
* Allows to pass the compile summary from AOT compilation to the JIT compiler,
|
|
714
|
-
* so that it can use the code generated by AOT.
|
|
715
|
-
*/
|
|
716
|
-
TestingCompiler.prototype.loadAotSummaries = /**
|
|
717
|
-
* Allows to pass the compile summary from AOT compilation to the JIT compiler,
|
|
718
|
-
* so that it can use the code generated by AOT.
|
|
719
|
-
*/
|
|
720
|
-
function (summaries) { throw unimplemented(); };
|
|
667
|
+
TestingCompiler.prototype.loadAotSummaries = function (summaries) { throw unimplemented(); };
|
|
721
668
|
/**
|
|
722
669
|
* Gets the component factory for the given component.
|
|
723
670
|
* This assumes that the component has been compiled before calling this call using
|
|
724
671
|
* `compileModuleAndAllComponents*`.
|
|
725
672
|
*/
|
|
726
|
-
|
|
727
|
-
* Gets the component factory for the given component.
|
|
728
|
-
* This assumes that the component has been compiled before calling this call using
|
|
729
|
-
* `compileModuleAndAllComponents*`.
|
|
730
|
-
*/
|
|
731
|
-
TestingCompiler.prototype.getComponentFactory = /**
|
|
732
|
-
* Gets the component factory for the given component.
|
|
733
|
-
* This assumes that the component has been compiled before calling this call using
|
|
734
|
-
* `compileModuleAndAllComponents*`.
|
|
735
|
-
*/
|
|
736
|
-
function (component) { throw unimplemented(); };
|
|
673
|
+
TestingCompiler.prototype.getComponentFactory = function (component) { throw unimplemented(); };
|
|
737
674
|
/**
|
|
738
675
|
* Returns the component type that is stored in the given error.
|
|
739
676
|
* This can be used for errors created by compileModule...
|
|
740
677
|
*/
|
|
741
|
-
|
|
742
|
-
* Returns the component type that is stored in the given error.
|
|
743
|
-
* This can be used for errors created by compileModule...
|
|
744
|
-
*/
|
|
745
|
-
TestingCompiler.prototype.getComponentFromError = /**
|
|
746
|
-
* Returns the component type that is stored in the given error.
|
|
747
|
-
* This can be used for errors created by compileModule...
|
|
748
|
-
*/
|
|
749
|
-
function (error) { throw unimplemented(); };
|
|
678
|
+
TestingCompiler.prototype.getComponentFromError = function (error) { throw unimplemented(); };
|
|
750
679
|
TestingCompiler.decorators = [
|
|
751
680
|
{ type: Injectable }
|
|
752
681
|
];
|
|
753
|
-
/** @nocollapse */
|
|
754
|
-
TestingCompiler.ctorParameters = function () { return []; };
|
|
755
682
|
return TestingCompiler;
|
|
756
683
|
}(Compiler));
|
|
757
684
|
/**
|
|
@@ -839,33 +766,7 @@ var TestBed = /** @class */ (function () {
|
|
|
839
766
|
*
|
|
840
767
|
* @experimental
|
|
841
768
|
*/
|
|
842
|
-
|
|
843
|
-
* Initialize the environment for testing with a compiler factory, a PlatformRef, and an
|
|
844
|
-
* angular module. These are common to every test in the suite.
|
|
845
|
-
*
|
|
846
|
-
* This may only be called once, to set up the common providers for the current test
|
|
847
|
-
* suite on the current platform. If you absolutely need to change the providers,
|
|
848
|
-
* first use `resetTestEnvironment`.
|
|
849
|
-
*
|
|
850
|
-
* Test modules and platforms for individual platforms are available from
|
|
851
|
-
* '@angular/<platform_name>/testing'.
|
|
852
|
-
*
|
|
853
|
-
* @experimental
|
|
854
|
-
*/
|
|
855
|
-
TestBed.initTestEnvironment = /**
|
|
856
|
-
* Initialize the environment for testing with a compiler factory, a PlatformRef, and an
|
|
857
|
-
* angular module. These are common to every test in the suite.
|
|
858
|
-
*
|
|
859
|
-
* This may only be called once, to set up the common providers for the current test
|
|
860
|
-
* suite on the current platform. If you absolutely need to change the providers,
|
|
861
|
-
* first use `resetTestEnvironment`.
|
|
862
|
-
*
|
|
863
|
-
* Test modules and platforms for individual platforms are available from
|
|
864
|
-
* '@angular/<platform_name>/testing'.
|
|
865
|
-
*
|
|
866
|
-
* @experimental
|
|
867
|
-
*/
|
|
868
|
-
function (ngModule, platform, aotSummaries) {
|
|
769
|
+
TestBed.initTestEnvironment = function (ngModule, platform, aotSummaries) {
|
|
869
770
|
var testBed = getTestBed();
|
|
870
771
|
testBed.initTestEnvironment(ngModule, platform, aotSummaries);
|
|
871
772
|
return testBed;
|
|
@@ -875,17 +776,7 @@ var TestBed = /** @class */ (function () {
|
|
|
875
776
|
*
|
|
876
777
|
* @experimental
|
|
877
778
|
*/
|
|
878
|
-
|
|
879
|
-
* Reset the providers for the test injector.
|
|
880
|
-
*
|
|
881
|
-
* @experimental
|
|
882
|
-
*/
|
|
883
|
-
TestBed.resetTestEnvironment = /**
|
|
884
|
-
* Reset the providers for the test injector.
|
|
885
|
-
*
|
|
886
|
-
* @experimental
|
|
887
|
-
*/
|
|
888
|
-
function () { getTestBed().resetTestEnvironment(); };
|
|
779
|
+
TestBed.resetTestEnvironment = function () { getTestBed().resetTestEnvironment(); };
|
|
889
780
|
TestBed.resetTestingModule = function () {
|
|
890
781
|
getTestBed().resetTestingModule();
|
|
891
782
|
return TestBed;
|
|
@@ -894,15 +785,7 @@ var TestBed = /** @class */ (function () {
|
|
|
894
785
|
* Allows overriding default compiler providers and settings
|
|
895
786
|
* which are defined in test_injector.js
|
|
896
787
|
*/
|
|
897
|
-
|
|
898
|
-
* Allows overriding default compiler providers and settings
|
|
899
|
-
* which are defined in test_injector.js
|
|
900
|
-
*/
|
|
901
|
-
TestBed.configureCompiler = /**
|
|
902
|
-
* Allows overriding default compiler providers and settings
|
|
903
|
-
* which are defined in test_injector.js
|
|
904
|
-
*/
|
|
905
|
-
function (config) {
|
|
788
|
+
TestBed.configureCompiler = function (config) {
|
|
906
789
|
getTestBed().configureCompiler(config);
|
|
907
790
|
return TestBed;
|
|
908
791
|
};
|
|
@@ -910,15 +793,7 @@ var TestBed = /** @class */ (function () {
|
|
|
910
793
|
* Allows overriding default providers, directives, pipes, modules of the test injector,
|
|
911
794
|
* which are defined in test_injector.js
|
|
912
795
|
*/
|
|
913
|
-
|
|
914
|
-
* Allows overriding default providers, directives, pipes, modules of the test injector,
|
|
915
|
-
* which are defined in test_injector.js
|
|
916
|
-
*/
|
|
917
|
-
TestBed.configureTestingModule = /**
|
|
918
|
-
* Allows overriding default providers, directives, pipes, modules of the test injector,
|
|
919
|
-
* which are defined in test_injector.js
|
|
920
|
-
*/
|
|
921
|
-
function (moduleDef) {
|
|
796
|
+
TestBed.configureTestingModule = function (moduleDef) {
|
|
922
797
|
getTestBed().configureTestingModule(moduleDef);
|
|
923
798
|
return TestBed;
|
|
924
799
|
};
|
|
@@ -927,17 +802,7 @@ var TestBed = /** @class */ (function () {
|
|
|
927
802
|
* It is necessary to call this function
|
|
928
803
|
* as fetching urls is asynchronous.
|
|
929
804
|
*/
|
|
930
|
-
|
|
931
|
-
* Compile components with a `templateUrl` for the test's NgModule.
|
|
932
|
-
* It is necessary to call this function
|
|
933
|
-
* as fetching urls is asynchronous.
|
|
934
|
-
*/
|
|
935
|
-
TestBed.compileComponents = /**
|
|
936
|
-
* Compile components with a `templateUrl` for the test's NgModule.
|
|
937
|
-
* It is necessary to call this function
|
|
938
|
-
* as fetching urls is asynchronous.
|
|
939
|
-
*/
|
|
940
|
-
function () { return getTestBed().compileComponents(); };
|
|
805
|
+
TestBed.compileComponents = function () { return getTestBed().compileComponents(); };
|
|
941
806
|
TestBed.overrideModule = function (ngModule, override) {
|
|
942
807
|
getTestBed().overrideModule(ngModule, override);
|
|
943
808
|
return TestBed;
|
|
@@ -955,7 +820,7 @@ var TestBed = /** @class */ (function () {
|
|
|
955
820
|
return TestBed;
|
|
956
821
|
};
|
|
957
822
|
TestBed.overrideTemplate = function (component, template) {
|
|
958
|
-
getTestBed().overrideComponent(component, { set: { template: template, templateUrl:
|
|
823
|
+
getTestBed().overrideComponent(component, { set: { template: template, templateUrl: null } });
|
|
959
824
|
return TestBed;
|
|
960
825
|
};
|
|
961
826
|
/**
|
|
@@ -964,19 +829,7 @@ var TestBed = /** @class */ (function () {
|
|
|
964
829
|
*
|
|
965
830
|
* Note: This works for JIT and AOTed components as well.
|
|
966
831
|
*/
|
|
967
|
-
|
|
968
|
-
* Overrides the template of the given component, compiling the template
|
|
969
|
-
* in the context of the TestingModule.
|
|
970
|
-
*
|
|
971
|
-
* Note: This works for JIT and AOTed components as well.
|
|
972
|
-
*/
|
|
973
|
-
TestBed.overrideTemplateUsingTestingModule = /**
|
|
974
|
-
* Overrides the template of the given component, compiling the template
|
|
975
|
-
* in the context of the TestingModule.
|
|
976
|
-
*
|
|
977
|
-
* Note: This works for JIT and AOTed components as well.
|
|
978
|
-
*/
|
|
979
|
-
function (component, template) {
|
|
832
|
+
TestBed.overrideTemplateUsingTestingModule = function (component, template) {
|
|
980
833
|
getTestBed().overrideTemplateUsingTestingModule(component, template);
|
|
981
834
|
return TestBed;
|
|
982
835
|
};
|
|
@@ -1008,33 +861,7 @@ var TestBed = /** @class */ (function () {
|
|
|
1008
861
|
*
|
|
1009
862
|
* @experimental
|
|
1010
863
|
*/
|
|
1011
|
-
|
|
1012
|
-
* Initialize the environment for testing with a compiler factory, a PlatformRef, and an
|
|
1013
|
-
* angular module. These are common to every test in the suite.
|
|
1014
|
-
*
|
|
1015
|
-
* This may only be called once, to set up the common providers for the current test
|
|
1016
|
-
* suite on the current platform. If you absolutely need to change the providers,
|
|
1017
|
-
* first use `resetTestEnvironment`.
|
|
1018
|
-
*
|
|
1019
|
-
* Test modules and platforms for individual platforms are available from
|
|
1020
|
-
* '@angular/<platform_name>/testing'.
|
|
1021
|
-
*
|
|
1022
|
-
* @experimental
|
|
1023
|
-
*/
|
|
1024
|
-
TestBed.prototype.initTestEnvironment = /**
|
|
1025
|
-
* Initialize the environment for testing with a compiler factory, a PlatformRef, and an
|
|
1026
|
-
* angular module. These are common to every test in the suite.
|
|
1027
|
-
*
|
|
1028
|
-
* This may only be called once, to set up the common providers for the current test
|
|
1029
|
-
* suite on the current platform. If you absolutely need to change the providers,
|
|
1030
|
-
* first use `resetTestEnvironment`.
|
|
1031
|
-
*
|
|
1032
|
-
* Test modules and platforms for individual platforms are available from
|
|
1033
|
-
* '@angular/<platform_name>/testing'.
|
|
1034
|
-
*
|
|
1035
|
-
* @experimental
|
|
1036
|
-
*/
|
|
1037
|
-
function (ngModule, platform, aotSummaries) {
|
|
864
|
+
TestBed.prototype.initTestEnvironment = function (ngModule, platform, aotSummaries) {
|
|
1038
865
|
if (this.platform || this.ngModule) {
|
|
1039
866
|
throw new Error('Cannot set base providers because it has already been called');
|
|
1040
867
|
}
|
|
@@ -1049,35 +876,25 @@ var TestBed = /** @class */ (function () {
|
|
|
1049
876
|
*
|
|
1050
877
|
* @experimental
|
|
1051
878
|
*/
|
|
1052
|
-
|
|
1053
|
-
* Reset the providers for the test injector.
|
|
1054
|
-
*
|
|
1055
|
-
* @experimental
|
|
1056
|
-
*/
|
|
1057
|
-
TestBed.prototype.resetTestEnvironment = /**
|
|
1058
|
-
* Reset the providers for the test injector.
|
|
1059
|
-
*
|
|
1060
|
-
* @experimental
|
|
1061
|
-
*/
|
|
1062
|
-
function () {
|
|
879
|
+
TestBed.prototype.resetTestEnvironment = function () {
|
|
1063
880
|
this.resetTestingModule();
|
|
1064
|
-
this.platform =
|
|
1065
|
-
this.ngModule =
|
|
881
|
+
this.platform = null;
|
|
882
|
+
this.ngModule = null;
|
|
1066
883
|
this._testEnvAotSummaries = function () { return []; };
|
|
1067
884
|
};
|
|
1068
885
|
TestBed.prototype.resetTestingModule = function () {
|
|
1069
886
|
ɵclearOverrides();
|
|
1070
887
|
this._aotSummaries = [];
|
|
1071
888
|
this._templateOverrides = [];
|
|
1072
|
-
this._compiler =
|
|
889
|
+
this._compiler = null;
|
|
1073
890
|
this._moduleOverrides = [];
|
|
1074
891
|
this._componentOverrides = [];
|
|
1075
892
|
this._directiveOverrides = [];
|
|
1076
893
|
this._pipeOverrides = [];
|
|
1077
894
|
this._isRoot = true;
|
|
1078
895
|
this._rootProviderOverrides = [];
|
|
1079
|
-
this._moduleRef =
|
|
1080
|
-
this._moduleFactory =
|
|
896
|
+
this._moduleRef = null;
|
|
897
|
+
this._moduleFactory = null;
|
|
1081
898
|
this._compilerOptions = [];
|
|
1082
899
|
this._providers = [];
|
|
1083
900
|
this._declarations = [];
|
|
@@ -1176,8 +993,6 @@ var TestBed = /** @class */ (function () {
|
|
|
1176
993
|
this._moduleRef = this._moduleFactory.create(ngZoneInjector);
|
|
1177
994
|
// ApplicationInitStatus.runInitializers() is marked @internal to core. So casting to any
|
|
1178
995
|
// before accessing it.
|
|
1179
|
-
// ApplicationInitStatus.runInitializers() is marked @internal to core. So casting to any
|
|
1180
|
-
// before accessing it.
|
|
1181
996
|
this._moduleRef.injector.get(ApplicationInitStatus).runInitializers();
|
|
1182
997
|
this._instantiated = true;
|
|
1183
998
|
var e_1, _d;
|
|
@@ -1197,8 +1012,6 @@ var TestBed = /** @class */ (function () {
|
|
|
1197
1012
|
providers: __spread(rootProviderOverrides),
|
|
1198
1013
|
},] },
|
|
1199
1014
|
];
|
|
1200
|
-
/** @nocollapse */
|
|
1201
|
-
RootScopeModule.ctorParameters = function () { return []; };
|
|
1202
1015
|
return RootScopeModule;
|
|
1203
1016
|
}());
|
|
1204
1017
|
rootScopeImports.push(RootScopeModule);
|
|
@@ -1212,8 +1025,6 @@ var TestBed = /** @class */ (function () {
|
|
|
1212
1025
|
DynamicTestModule.decorators = [
|
|
1213
1026
|
{ type: NgModule, args: [{ providers: providers, declarations: declarations, imports: imports, schemas: schemas },] },
|
|
1214
1027
|
];
|
|
1215
|
-
/** @nocollapse */
|
|
1216
|
-
DynamicTestModule.ctorParameters = function () { return []; };
|
|
1217
1028
|
return DynamicTestModule;
|
|
1218
1029
|
}());
|
|
1219
1030
|
var compilerFactory = this.platform.injector.get(TestingCompilerFactory);
|
|
@@ -1281,7 +1092,7 @@ var TestBed = /** @class */ (function () {
|
|
|
1281
1092
|
this.overrideProviderImpl(token, provider);
|
|
1282
1093
|
};
|
|
1283
1094
|
TestBed.prototype.deprecatedOverrideProvider = function (token, provider) {
|
|
1284
|
-
this.overrideProviderImpl(token, provider, /* deprecated */
|
|
1095
|
+
this.overrideProviderImpl(token, provider, /* deprecated */ true);
|
|
1285
1096
|
};
|
|
1286
1097
|
TestBed.prototype.overrideProviderImpl = function (token, provider, deprecated) {
|
|
1287
1098
|
if (deprecated === void 0) { deprecated = false; }
|
|
@@ -1335,8 +1146,6 @@ var TestBed = /** @class */ (function () {
|
|
|
1335
1146
|
OverrideComponent.decorators = [
|
|
1336
1147
|
{ type: Component, args: [{ selector: 'empty', template: template },] },
|
|
1337
1148
|
];
|
|
1338
|
-
/** @nocollapse */
|
|
1339
|
-
OverrideComponent.ctorParameters = function () { return []; };
|
|
1340
1149
|
return OverrideComponent;
|
|
1341
1150
|
}());
|
|
1342
1151
|
this._templateOverrides.push({ component: component, templateOf: OverrideComponent });
|
|
@@ -1364,7 +1173,7 @@ var TestBed = /** @class */ (function () {
|
|
|
1364
1173
|
};
|
|
1365
1174
|
return TestBed;
|
|
1366
1175
|
}());
|
|
1367
|
-
var _testBed =
|
|
1176
|
+
var _testBed = null;
|
|
1368
1177
|
/**
|
|
1369
1178
|
* @experimental
|
|
1370
1179
|
*/
|
|
@@ -1459,6 +1268,11 @@ function withModule(moduleDef, fn) {
|
|
|
1459
1268
|
* Use of this source code is governed by an MIT-style license that can be
|
|
1460
1269
|
* found in the LICENSE file at https://angular.io/license
|
|
1461
1270
|
*/
|
|
1271
|
+
/**
|
|
1272
|
+
* Public Test Library for unit testing Angular applications. Assumes that you are running
|
|
1273
|
+
* with Jasmine, Mocha, or a similar framework which exports a beforeEach function and
|
|
1274
|
+
* allows tests to be asynchronous by either returning a promise or using a 'done' parameter.
|
|
1275
|
+
*/
|
|
1462
1276
|
var _global$1 = (typeof window === 'undefined' ? global : window);
|
|
1463
1277
|
// Reset the test providers and the fake async zone before each test.
|
|
1464
1278
|
if (_global$1.beforeEach) {
|
|
@@ -1570,10 +1384,6 @@ function ensureDocument() {
|
|
|
1570
1384
|
// https://github.com/angular/angular/blob/7cf5e95ac9f0f2648beebf0d5bd9056b79946970/packages/platform-browser/src/dom/events/dom_events.ts#L112-L132
|
|
1571
1385
|
// It fails with Domino with TypeError: Cannot assign to read only property
|
|
1572
1386
|
// 'stopImmediatePropagation' of object '#<Event>'
|
|
1573
|
-
// Trick to avoid Event patching from
|
|
1574
|
-
// https://github.com/angular/angular/blob/7cf5e95ac9f0f2648beebf0d5bd9056b79946970/packages/platform-browser/src/dom/events/dom_events.ts#L112-L132
|
|
1575
|
-
// It fails with Domino with TypeError: Cannot assign to read only property
|
|
1576
|
-
// 'stopImmediatePropagation' of object '#<Event>'
|
|
1577
1387
|
global.Event = null;
|
|
1578
1388
|
savedNode = global.Node;
|
|
1579
1389
|
global.Node = domino.impl.Node;
|
|
@@ -1615,6 +1425,11 @@ if (typeof afterEach == 'function')
|
|
|
1615
1425
|
* Use of this source code is governed by an MIT-style license that can be
|
|
1616
1426
|
* found in the LICENSE file at https://angular.io/license
|
|
1617
1427
|
*/
|
|
1428
|
+
/**
|
|
1429
|
+
* @module
|
|
1430
|
+
* @description
|
|
1431
|
+
* Entry point for all public APIs of the core/testing package.
|
|
1432
|
+
*/
|
|
1618
1433
|
|
|
1619
1434
|
/**
|
|
1620
1435
|
* @license
|
|
@@ -1623,6 +1438,11 @@ if (typeof afterEach == 'function')
|
|
|
1623
1438
|
* Use of this source code is governed by an MIT-style license that can be
|
|
1624
1439
|
* found in the LICENSE file at https://angular.io/license
|
|
1625
1440
|
*/
|
|
1441
|
+
/**
|
|
1442
|
+
* @module
|
|
1443
|
+
* @description
|
|
1444
|
+
* Entry point for all public APIs of this package.
|
|
1445
|
+
*/
|
|
1626
1446
|
|
|
1627
1447
|
// This file only reexports content of the `src` folder. Keep it that way.
|
|
1628
1448
|
|
|
@@ -1633,6 +1453,10 @@ if (typeof afterEach == 'function')
|
|
|
1633
1453
|
* Use of this source code is governed by an MIT-style license that can be
|
|
1634
1454
|
* found in the LICENSE file at https://angular.io/license
|
|
1635
1455
|
*/
|
|
1456
|
+
// This file is not used to build this module. It is only used during editing
|
|
1457
|
+
// by the TypeScript language service and during build for verification. `ngc`
|
|
1458
|
+
// replaces this file with production index.ts when it rewrites private symbol
|
|
1459
|
+
// names.
|
|
1636
1460
|
|
|
1637
1461
|
/**
|
|
1638
1462
|
* Generated bundle index. Do not edit.
|