@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
|
@@ -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
|
*/
|
|
@@ -195,8 +195,6 @@ var ComponentFixture = /** @class */ (function () {
|
|
|
195
195
|
_this._onMicrotaskEmptySubscription = ngZone.onMicrotaskEmpty.subscribe({
|
|
196
196
|
next: function () {
|
|
197
197
|
if (_this._autoDetect) {
|
|
198
|
-
// Do a change detection run with checkNoChanges set to true to check
|
|
199
|
-
// there are no changes on the second run.
|
|
200
198
|
// Do a change detection run with checkNoChanges set to true to check
|
|
201
199
|
// there are no changes on the second run.
|
|
202
200
|
_this.detectChanges(true);
|
|
@@ -237,13 +235,7 @@ var ComponentFixture = /** @class */ (function () {
|
|
|
237
235
|
/**
|
|
238
236
|
* Trigger a change detection cycle for the component.
|
|
239
237
|
*/
|
|
240
|
-
|
|
241
|
-
* Trigger a change detection cycle for the component.
|
|
242
|
-
*/
|
|
243
|
-
ComponentFixture.prototype.detectChanges = /**
|
|
244
|
-
* Trigger a change detection cycle for the component.
|
|
245
|
-
*/
|
|
246
|
-
function (checkNoChanges) {
|
|
238
|
+
ComponentFixture.prototype.detectChanges = function (checkNoChanges) {
|
|
247
239
|
var _this = this;
|
|
248
240
|
if (checkNoChanges === void 0) { checkNoChanges = true; }
|
|
249
241
|
if (this.ngZone != null) {
|
|
@@ -259,29 +251,13 @@ var ComponentFixture = /** @class */ (function () {
|
|
|
259
251
|
/**
|
|
260
252
|
* Do a change detection run to make sure there were no changes.
|
|
261
253
|
*/
|
|
262
|
-
|
|
263
|
-
* Do a change detection run to make sure there were no changes.
|
|
264
|
-
*/
|
|
265
|
-
ComponentFixture.prototype.checkNoChanges = /**
|
|
266
|
-
* Do a change detection run to make sure there were no changes.
|
|
267
|
-
*/
|
|
268
|
-
function () { this.changeDetectorRef.checkNoChanges(); };
|
|
254
|
+
ComponentFixture.prototype.checkNoChanges = function () { this.changeDetectorRef.checkNoChanges(); };
|
|
269
255
|
/**
|
|
270
256
|
* Set whether the fixture should autodetect changes.
|
|
271
257
|
*
|
|
272
258
|
* Also runs detectChanges once so that any existing change is detected.
|
|
273
259
|
*/
|
|
274
|
-
|
|
275
|
-
* Set whether the fixture should autodetect changes.
|
|
276
|
-
*
|
|
277
|
-
* Also runs detectChanges once so that any existing change is detected.
|
|
278
|
-
*/
|
|
279
|
-
ComponentFixture.prototype.autoDetectChanges = /**
|
|
280
|
-
* Set whether the fixture should autodetect changes.
|
|
281
|
-
*
|
|
282
|
-
* Also runs detectChanges once so that any existing change is detected.
|
|
283
|
-
*/
|
|
284
|
-
function (autoDetect) {
|
|
260
|
+
ComponentFixture.prototype.autoDetectChanges = function (autoDetect) {
|
|
285
261
|
if (autoDetect === void 0) { autoDetect = true; }
|
|
286
262
|
if (this.ngZone == null) {
|
|
287
263
|
throw new Error('Cannot call autoDetectChanges when ComponentFixtureNoNgZone is set');
|
|
@@ -293,34 +269,14 @@ var ComponentFixture = /** @class */ (function () {
|
|
|
293
269
|
* Return whether the fixture is currently stable or has async tasks that have not been completed
|
|
294
270
|
* yet.
|
|
295
271
|
*/
|
|
296
|
-
|
|
297
|
-
* Return whether the fixture is currently stable or has async tasks that have not been completed
|
|
298
|
-
* yet.
|
|
299
|
-
*/
|
|
300
|
-
ComponentFixture.prototype.isStable = /**
|
|
301
|
-
* Return whether the fixture is currently stable or has async tasks that have not been completed
|
|
302
|
-
* yet.
|
|
303
|
-
*/
|
|
304
|
-
function () { return this._isStable && !this.ngZone.hasPendingMacrotasks; };
|
|
272
|
+
ComponentFixture.prototype.isStable = function () { return this._isStable && !this.ngZone.hasPendingMacrotasks; };
|
|
305
273
|
/**
|
|
306
274
|
* Get a promise that resolves when the fixture is stable.
|
|
307
275
|
*
|
|
308
276
|
* This can be used to resume testing after events have triggered asynchronous activity or
|
|
309
277
|
* asynchronous change detection.
|
|
310
278
|
*/
|
|
311
|
-
|
|
312
|
-
* Get a promise that resolves when the fixture is stable.
|
|
313
|
-
*
|
|
314
|
-
* This can be used to resume testing after events have triggered asynchronous activity or
|
|
315
|
-
* asynchronous change detection.
|
|
316
|
-
*/
|
|
317
|
-
ComponentFixture.prototype.whenStable = /**
|
|
318
|
-
* Get a promise that resolves when the fixture is stable.
|
|
319
|
-
*
|
|
320
|
-
* This can be used to resume testing after events have triggered asynchronous activity or
|
|
321
|
-
* asynchronous change detection.
|
|
322
|
-
*/
|
|
323
|
-
function () {
|
|
279
|
+
ComponentFixture.prototype.whenStable = function () {
|
|
324
280
|
var _this = this;
|
|
325
281
|
if (this.isStable()) {
|
|
326
282
|
return Promise.resolve(false);
|
|
@@ -342,13 +298,7 @@ var ComponentFixture = /** @class */ (function () {
|
|
|
342
298
|
/**
|
|
343
299
|
* Get a promise that resolves when the ui state is stable following animations.
|
|
344
300
|
*/
|
|
345
|
-
|
|
346
|
-
* Get a promise that resolves when the ui state is stable following animations.
|
|
347
|
-
*/
|
|
348
|
-
ComponentFixture.prototype.whenRenderingDone = /**
|
|
349
|
-
* Get a promise that resolves when the ui state is stable following animations.
|
|
350
|
-
*/
|
|
351
|
-
function () {
|
|
301
|
+
ComponentFixture.prototype.whenRenderingDone = function () {
|
|
352
302
|
var renderer = this._getRenderer();
|
|
353
303
|
if (renderer && renderer.whenRenderingDone) {
|
|
354
304
|
return renderer.whenRenderingDone();
|
|
@@ -358,13 +308,7 @@ var ComponentFixture = /** @class */ (function () {
|
|
|
358
308
|
/**
|
|
359
309
|
* Trigger component destruction.
|
|
360
310
|
*/
|
|
361
|
-
|
|
362
|
-
* Trigger component destruction.
|
|
363
|
-
*/
|
|
364
|
-
ComponentFixture.prototype.destroy = /**
|
|
365
|
-
* Trigger component destruction.
|
|
366
|
-
*/
|
|
367
|
-
function () {
|
|
311
|
+
ComponentFixture.prototype.destroy = function () {
|
|
368
312
|
if (!this._isDestroyed) {
|
|
369
313
|
this.componentRef.destroy();
|
|
370
314
|
if (this._onUnstableSubscription != null) {
|
|
@@ -428,7 +372,8 @@ var _inFakeAsyncCall = false;
|
|
|
428
372
|
*
|
|
429
373
|
* Can be used to wrap inject() calls.
|
|
430
374
|
*
|
|
431
|
-
*
|
|
375
|
+
* @usageNotes
|
|
376
|
+
* ### Example
|
|
432
377
|
*
|
|
433
378
|
* {@example core/testing/ts/fake_async.ts region='basic'}
|
|
434
379
|
*
|
|
@@ -493,7 +438,8 @@ function _getFakeAsyncZoneSpec() {
|
|
|
493
438
|
* The microtasks queue is drained at the very start of this function and after any timer callback
|
|
494
439
|
* has been executed.
|
|
495
440
|
*
|
|
496
|
-
*
|
|
441
|
+
* @usageNotes
|
|
442
|
+
* ### Example
|
|
497
443
|
*
|
|
498
444
|
* {@example core/testing/ts/fake_async.ts region='basic'}
|
|
499
445
|
*
|
|
@@ -535,6 +481,13 @@ function flushMicrotasksFallback() {
|
|
|
535
481
|
_getFakeAsyncZoneSpec().flushMicrotasks();
|
|
536
482
|
}
|
|
537
483
|
|
|
484
|
+
/**
|
|
485
|
+
* @license
|
|
486
|
+
* Copyright Google Inc. All Rights Reserved.
|
|
487
|
+
*
|
|
488
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
489
|
+
* found in the LICENSE file at https://angular.io/license
|
|
490
|
+
*/
|
|
538
491
|
var _Zone = typeof Zone !== 'undefined' ? Zone : null;
|
|
539
492
|
var fakeAsyncTestModule = _Zone && _Zone[_Zone.__symbol__('fakeAsyncTest')];
|
|
540
493
|
/**
|
|
@@ -560,7 +513,8 @@ function resetFakeAsyncZone() {
|
|
|
560
513
|
*
|
|
561
514
|
* Can be used to wrap inject() calls.
|
|
562
515
|
*
|
|
563
|
-
*
|
|
516
|
+
* @usageNotes
|
|
517
|
+
* ### Example
|
|
564
518
|
*
|
|
565
519
|
* {@example core/testing/ts/fake_async.ts region='basic'}
|
|
566
520
|
*
|
|
@@ -583,7 +537,8 @@ function fakeAsync(fn) {
|
|
|
583
537
|
* The microtasks queue is drained at the very start of this function and after any timer callback
|
|
584
538
|
* has been executed.
|
|
585
539
|
*
|
|
586
|
-
*
|
|
540
|
+
* @usageNotes
|
|
541
|
+
* ### Example
|
|
587
542
|
*
|
|
588
543
|
* {@example core/testing/ts/fake_async.ts region='basic'}
|
|
589
544
|
*
|
|
@@ -788,49 +743,21 @@ var TestingCompiler = /** @class */ (function (_super) {
|
|
|
788
743
|
* Allows to pass the compile summary from AOT compilation to the JIT compiler,
|
|
789
744
|
* so that it can use the code generated by AOT.
|
|
790
745
|
*/
|
|
791
|
-
|
|
792
|
-
* Allows to pass the compile summary from AOT compilation to the JIT compiler,
|
|
793
|
-
* so that it can use the code generated by AOT.
|
|
794
|
-
*/
|
|
795
|
-
TestingCompiler.prototype.loadAotSummaries = /**
|
|
796
|
-
* Allows to pass the compile summary from AOT compilation to the JIT compiler,
|
|
797
|
-
* so that it can use the code generated by AOT.
|
|
798
|
-
*/
|
|
799
|
-
function (summaries) { throw unimplemented(); };
|
|
746
|
+
TestingCompiler.prototype.loadAotSummaries = function (summaries) { throw unimplemented(); };
|
|
800
747
|
/**
|
|
801
748
|
* Gets the component factory for the given component.
|
|
802
749
|
* This assumes that the component has been compiled before calling this call using
|
|
803
750
|
* `compileModuleAndAllComponents*`.
|
|
804
751
|
*/
|
|
805
|
-
|
|
806
|
-
* Gets the component factory for the given component.
|
|
807
|
-
* This assumes that the component has been compiled before calling this call using
|
|
808
|
-
* `compileModuleAndAllComponents*`.
|
|
809
|
-
*/
|
|
810
|
-
TestingCompiler.prototype.getComponentFactory = /**
|
|
811
|
-
* Gets the component factory for the given component.
|
|
812
|
-
* This assumes that the component has been compiled before calling this call using
|
|
813
|
-
* `compileModuleAndAllComponents*`.
|
|
814
|
-
*/
|
|
815
|
-
function (component) { throw unimplemented(); };
|
|
752
|
+
TestingCompiler.prototype.getComponentFactory = function (component) { throw unimplemented(); };
|
|
816
753
|
/**
|
|
817
754
|
* Returns the component type that is stored in the given error.
|
|
818
755
|
* This can be used for errors created by compileModule...
|
|
819
756
|
*/
|
|
820
|
-
|
|
821
|
-
* Returns the component type that is stored in the given error.
|
|
822
|
-
* This can be used for errors created by compileModule...
|
|
823
|
-
*/
|
|
824
|
-
TestingCompiler.prototype.getComponentFromError = /**
|
|
825
|
-
* Returns the component type that is stored in the given error.
|
|
826
|
-
* This can be used for errors created by compileModule...
|
|
827
|
-
*/
|
|
828
|
-
function (error) { throw unimplemented(); };
|
|
757
|
+
TestingCompiler.prototype.getComponentFromError = function (error) { throw unimplemented(); };
|
|
829
758
|
TestingCompiler.decorators = [
|
|
830
759
|
{ type: core.Injectable }
|
|
831
760
|
];
|
|
832
|
-
/** @nocollapse */
|
|
833
|
-
TestingCompiler.ctorParameters = function () { return []; };
|
|
834
761
|
return TestingCompiler;
|
|
835
762
|
}(core.Compiler));
|
|
836
763
|
/**
|
|
@@ -918,33 +845,7 @@ var TestBed = /** @class */ (function () {
|
|
|
918
845
|
*
|
|
919
846
|
* @experimental
|
|
920
847
|
*/
|
|
921
|
-
|
|
922
|
-
* Initialize the environment for testing with a compiler factory, a PlatformRef, and an
|
|
923
|
-
* angular module. These are common to every test in the suite.
|
|
924
|
-
*
|
|
925
|
-
* This may only be called once, to set up the common providers for the current test
|
|
926
|
-
* suite on the current platform. If you absolutely need to change the providers,
|
|
927
|
-
* first use `resetTestEnvironment`.
|
|
928
|
-
*
|
|
929
|
-
* Test modules and platforms for individual platforms are available from
|
|
930
|
-
* '@angular/<platform_name>/testing'.
|
|
931
|
-
*
|
|
932
|
-
* @experimental
|
|
933
|
-
*/
|
|
934
|
-
TestBed.initTestEnvironment = /**
|
|
935
|
-
* Initialize the environment for testing with a compiler factory, a PlatformRef, and an
|
|
936
|
-
* angular module. These are common to every test in the suite.
|
|
937
|
-
*
|
|
938
|
-
* This may only be called once, to set up the common providers for the current test
|
|
939
|
-
* suite on the current platform. If you absolutely need to change the providers,
|
|
940
|
-
* first use `resetTestEnvironment`.
|
|
941
|
-
*
|
|
942
|
-
* Test modules and platforms for individual platforms are available from
|
|
943
|
-
* '@angular/<platform_name>/testing'.
|
|
944
|
-
*
|
|
945
|
-
* @experimental
|
|
946
|
-
*/
|
|
947
|
-
function (ngModule, platform, aotSummaries) {
|
|
848
|
+
TestBed.initTestEnvironment = function (ngModule, platform, aotSummaries) {
|
|
948
849
|
var testBed = getTestBed();
|
|
949
850
|
testBed.initTestEnvironment(ngModule, platform, aotSummaries);
|
|
950
851
|
return testBed;
|
|
@@ -954,17 +855,7 @@ var TestBed = /** @class */ (function () {
|
|
|
954
855
|
*
|
|
955
856
|
* @experimental
|
|
956
857
|
*/
|
|
957
|
-
|
|
958
|
-
* Reset the providers for the test injector.
|
|
959
|
-
*
|
|
960
|
-
* @experimental
|
|
961
|
-
*/
|
|
962
|
-
TestBed.resetTestEnvironment = /**
|
|
963
|
-
* Reset the providers for the test injector.
|
|
964
|
-
*
|
|
965
|
-
* @experimental
|
|
966
|
-
*/
|
|
967
|
-
function () { getTestBed().resetTestEnvironment(); };
|
|
858
|
+
TestBed.resetTestEnvironment = function () { getTestBed().resetTestEnvironment(); };
|
|
968
859
|
TestBed.resetTestingModule = function () {
|
|
969
860
|
getTestBed().resetTestingModule();
|
|
970
861
|
return TestBed;
|
|
@@ -973,15 +864,7 @@ var TestBed = /** @class */ (function () {
|
|
|
973
864
|
* Allows overriding default compiler providers and settings
|
|
974
865
|
* which are defined in test_injector.js
|
|
975
866
|
*/
|
|
976
|
-
|
|
977
|
-
* Allows overriding default compiler providers and settings
|
|
978
|
-
* which are defined in test_injector.js
|
|
979
|
-
*/
|
|
980
|
-
TestBed.configureCompiler = /**
|
|
981
|
-
* Allows overriding default compiler providers and settings
|
|
982
|
-
* which are defined in test_injector.js
|
|
983
|
-
*/
|
|
984
|
-
function (config) {
|
|
867
|
+
TestBed.configureCompiler = function (config) {
|
|
985
868
|
getTestBed().configureCompiler(config);
|
|
986
869
|
return TestBed;
|
|
987
870
|
};
|
|
@@ -989,15 +872,7 @@ var TestBed = /** @class */ (function () {
|
|
|
989
872
|
* Allows overriding default providers, directives, pipes, modules of the test injector,
|
|
990
873
|
* which are defined in test_injector.js
|
|
991
874
|
*/
|
|
992
|
-
|
|
993
|
-
* Allows overriding default providers, directives, pipes, modules of the test injector,
|
|
994
|
-
* which are defined in test_injector.js
|
|
995
|
-
*/
|
|
996
|
-
TestBed.configureTestingModule = /**
|
|
997
|
-
* Allows overriding default providers, directives, pipes, modules of the test injector,
|
|
998
|
-
* which are defined in test_injector.js
|
|
999
|
-
*/
|
|
1000
|
-
function (moduleDef) {
|
|
875
|
+
TestBed.configureTestingModule = function (moduleDef) {
|
|
1001
876
|
getTestBed().configureTestingModule(moduleDef);
|
|
1002
877
|
return TestBed;
|
|
1003
878
|
};
|
|
@@ -1006,17 +881,7 @@ var TestBed = /** @class */ (function () {
|
|
|
1006
881
|
* It is necessary to call this function
|
|
1007
882
|
* as fetching urls is asynchronous.
|
|
1008
883
|
*/
|
|
1009
|
-
|
|
1010
|
-
* Compile components with a `templateUrl` for the test's NgModule.
|
|
1011
|
-
* It is necessary to call this function
|
|
1012
|
-
* as fetching urls is asynchronous.
|
|
1013
|
-
*/
|
|
1014
|
-
TestBed.compileComponents = /**
|
|
1015
|
-
* Compile components with a `templateUrl` for the test's NgModule.
|
|
1016
|
-
* It is necessary to call this function
|
|
1017
|
-
* as fetching urls is asynchronous.
|
|
1018
|
-
*/
|
|
1019
|
-
function () { return getTestBed().compileComponents(); };
|
|
884
|
+
TestBed.compileComponents = function () { return getTestBed().compileComponents(); };
|
|
1020
885
|
TestBed.overrideModule = function (ngModule, override) {
|
|
1021
886
|
getTestBed().overrideModule(ngModule, override);
|
|
1022
887
|
return TestBed;
|
|
@@ -1034,7 +899,7 @@ var TestBed = /** @class */ (function () {
|
|
|
1034
899
|
return TestBed;
|
|
1035
900
|
};
|
|
1036
901
|
TestBed.overrideTemplate = function (component, template) {
|
|
1037
|
-
getTestBed().overrideComponent(component, { set: { template: template, templateUrl:
|
|
902
|
+
getTestBed().overrideComponent(component, { set: { template: template, templateUrl: null } });
|
|
1038
903
|
return TestBed;
|
|
1039
904
|
};
|
|
1040
905
|
/**
|
|
@@ -1043,19 +908,7 @@ var TestBed = /** @class */ (function () {
|
|
|
1043
908
|
*
|
|
1044
909
|
* Note: This works for JIT and AOTed components as well.
|
|
1045
910
|
*/
|
|
1046
|
-
|
|
1047
|
-
* Overrides the template of the given component, compiling the template
|
|
1048
|
-
* in the context of the TestingModule.
|
|
1049
|
-
*
|
|
1050
|
-
* Note: This works for JIT and AOTed components as well.
|
|
1051
|
-
*/
|
|
1052
|
-
TestBed.overrideTemplateUsingTestingModule = /**
|
|
1053
|
-
* Overrides the template of the given component, compiling the template
|
|
1054
|
-
* in the context of the TestingModule.
|
|
1055
|
-
*
|
|
1056
|
-
* Note: This works for JIT and AOTed components as well.
|
|
1057
|
-
*/
|
|
1058
|
-
function (component, template) {
|
|
911
|
+
TestBed.overrideTemplateUsingTestingModule = function (component, template) {
|
|
1059
912
|
getTestBed().overrideTemplateUsingTestingModule(component, template);
|
|
1060
913
|
return TestBed;
|
|
1061
914
|
};
|
|
@@ -1087,33 +940,7 @@ var TestBed = /** @class */ (function () {
|
|
|
1087
940
|
*
|
|
1088
941
|
* @experimental
|
|
1089
942
|
*/
|
|
1090
|
-
|
|
1091
|
-
* Initialize the environment for testing with a compiler factory, a PlatformRef, and an
|
|
1092
|
-
* angular module. These are common to every test in the suite.
|
|
1093
|
-
*
|
|
1094
|
-
* This may only be called once, to set up the common providers for the current test
|
|
1095
|
-
* suite on the current platform. If you absolutely need to change the providers,
|
|
1096
|
-
* first use `resetTestEnvironment`.
|
|
1097
|
-
*
|
|
1098
|
-
* Test modules and platforms for individual platforms are available from
|
|
1099
|
-
* '@angular/<platform_name>/testing'.
|
|
1100
|
-
*
|
|
1101
|
-
* @experimental
|
|
1102
|
-
*/
|
|
1103
|
-
TestBed.prototype.initTestEnvironment = /**
|
|
1104
|
-
* Initialize the environment for testing with a compiler factory, a PlatformRef, and an
|
|
1105
|
-
* angular module. These are common to every test in the suite.
|
|
1106
|
-
*
|
|
1107
|
-
* This may only be called once, to set up the common providers for the current test
|
|
1108
|
-
* suite on the current platform. If you absolutely need to change the providers,
|
|
1109
|
-
* first use `resetTestEnvironment`.
|
|
1110
|
-
*
|
|
1111
|
-
* Test modules and platforms for individual platforms are available from
|
|
1112
|
-
* '@angular/<platform_name>/testing'.
|
|
1113
|
-
*
|
|
1114
|
-
* @experimental
|
|
1115
|
-
*/
|
|
1116
|
-
function (ngModule, platform, aotSummaries) {
|
|
943
|
+
TestBed.prototype.initTestEnvironment = function (ngModule, platform, aotSummaries) {
|
|
1117
944
|
if (this.platform || this.ngModule) {
|
|
1118
945
|
throw new Error('Cannot set base providers because it has already been called');
|
|
1119
946
|
}
|
|
@@ -1128,35 +955,25 @@ var TestBed = /** @class */ (function () {
|
|
|
1128
955
|
*
|
|
1129
956
|
* @experimental
|
|
1130
957
|
*/
|
|
1131
|
-
|
|
1132
|
-
* Reset the providers for the test injector.
|
|
1133
|
-
*
|
|
1134
|
-
* @experimental
|
|
1135
|
-
*/
|
|
1136
|
-
TestBed.prototype.resetTestEnvironment = /**
|
|
1137
|
-
* Reset the providers for the test injector.
|
|
1138
|
-
*
|
|
1139
|
-
* @experimental
|
|
1140
|
-
*/
|
|
1141
|
-
function () {
|
|
958
|
+
TestBed.prototype.resetTestEnvironment = function () {
|
|
1142
959
|
this.resetTestingModule();
|
|
1143
|
-
this.platform =
|
|
1144
|
-
this.ngModule =
|
|
960
|
+
this.platform = null;
|
|
961
|
+
this.ngModule = null;
|
|
1145
962
|
this._testEnvAotSummaries = function () { return []; };
|
|
1146
963
|
};
|
|
1147
964
|
TestBed.prototype.resetTestingModule = function () {
|
|
1148
965
|
core.ɵclearOverrides();
|
|
1149
966
|
this._aotSummaries = [];
|
|
1150
967
|
this._templateOverrides = [];
|
|
1151
|
-
this._compiler =
|
|
968
|
+
this._compiler = null;
|
|
1152
969
|
this._moduleOverrides = [];
|
|
1153
970
|
this._componentOverrides = [];
|
|
1154
971
|
this._directiveOverrides = [];
|
|
1155
972
|
this._pipeOverrides = [];
|
|
1156
973
|
this._isRoot = true;
|
|
1157
974
|
this._rootProviderOverrides = [];
|
|
1158
|
-
this._moduleRef =
|
|
1159
|
-
this._moduleFactory =
|
|
975
|
+
this._moduleRef = null;
|
|
976
|
+
this._moduleFactory = null;
|
|
1160
977
|
this._compilerOptions = [];
|
|
1161
978
|
this._providers = [];
|
|
1162
979
|
this._declarations = [];
|
|
@@ -1255,8 +1072,6 @@ var TestBed = /** @class */ (function () {
|
|
|
1255
1072
|
this._moduleRef = this._moduleFactory.create(ngZoneInjector);
|
|
1256
1073
|
// ApplicationInitStatus.runInitializers() is marked @internal to core. So casting to any
|
|
1257
1074
|
// before accessing it.
|
|
1258
|
-
// ApplicationInitStatus.runInitializers() is marked @internal to core. So casting to any
|
|
1259
|
-
// before accessing it.
|
|
1260
1075
|
this._moduleRef.injector.get(core.ApplicationInitStatus).runInitializers();
|
|
1261
1076
|
this._instantiated = true;
|
|
1262
1077
|
var e_1, _d;
|
|
@@ -1276,8 +1091,6 @@ var TestBed = /** @class */ (function () {
|
|
|
1276
1091
|
providers: __spread(rootProviderOverrides),
|
|
1277
1092
|
},] },
|
|
1278
1093
|
];
|
|
1279
|
-
/** @nocollapse */
|
|
1280
|
-
RootScopeModule.ctorParameters = function () { return []; };
|
|
1281
1094
|
return RootScopeModule;
|
|
1282
1095
|
}());
|
|
1283
1096
|
rootScopeImports.push(RootScopeModule);
|
|
@@ -1291,8 +1104,6 @@ var TestBed = /** @class */ (function () {
|
|
|
1291
1104
|
DynamicTestModule.decorators = [
|
|
1292
1105
|
{ type: core.NgModule, args: [{ providers: providers, declarations: declarations, imports: imports, schemas: schemas },] },
|
|
1293
1106
|
];
|
|
1294
|
-
/** @nocollapse */
|
|
1295
|
-
DynamicTestModule.ctorParameters = function () { return []; };
|
|
1296
1107
|
return DynamicTestModule;
|
|
1297
1108
|
}());
|
|
1298
1109
|
var compilerFactory = this.platform.injector.get(TestingCompilerFactory);
|
|
@@ -1360,7 +1171,7 @@ var TestBed = /** @class */ (function () {
|
|
|
1360
1171
|
this.overrideProviderImpl(token, provider);
|
|
1361
1172
|
};
|
|
1362
1173
|
TestBed.prototype.deprecatedOverrideProvider = function (token, provider) {
|
|
1363
|
-
this.overrideProviderImpl(token, provider, /* deprecated */
|
|
1174
|
+
this.overrideProviderImpl(token, provider, /* deprecated */ true);
|
|
1364
1175
|
};
|
|
1365
1176
|
TestBed.prototype.overrideProviderImpl = function (token, provider, deprecated) {
|
|
1366
1177
|
if (deprecated === void 0) { deprecated = false; }
|
|
@@ -1414,8 +1225,6 @@ var TestBed = /** @class */ (function () {
|
|
|
1414
1225
|
OverrideComponent.decorators = [
|
|
1415
1226
|
{ type: core.Component, args: [{ selector: 'empty', template: template },] },
|
|
1416
1227
|
];
|
|
1417
|
-
/** @nocollapse */
|
|
1418
|
-
OverrideComponent.ctorParameters = function () { return []; };
|
|
1419
1228
|
return OverrideComponent;
|
|
1420
1229
|
}());
|
|
1421
1230
|
this._templateOverrides.push({ component: component, templateOf: OverrideComponent });
|
|
@@ -1443,7 +1252,7 @@ var TestBed = /** @class */ (function () {
|
|
|
1443
1252
|
};
|
|
1444
1253
|
return TestBed;
|
|
1445
1254
|
}());
|
|
1446
|
-
var _testBed =
|
|
1255
|
+
var _testBed = null;
|
|
1447
1256
|
/**
|
|
1448
1257
|
* @experimental
|
|
1449
1258
|
*/
|
|
@@ -1538,6 +1347,11 @@ function withModule(moduleDef, fn) {
|
|
|
1538
1347
|
* Use of this source code is governed by an MIT-style license that can be
|
|
1539
1348
|
* found in the LICENSE file at https://angular.io/license
|
|
1540
1349
|
*/
|
|
1350
|
+
/**
|
|
1351
|
+
* Public Test Library for unit testing Angular applications. Assumes that you are running
|
|
1352
|
+
* with Jasmine, Mocha, or a similar framework which exports a beforeEach function and
|
|
1353
|
+
* allows tests to be asynchronous by either returning a promise or using a 'done' parameter.
|
|
1354
|
+
*/
|
|
1541
1355
|
var _global$1 = (typeof window === 'undefined' ? global : window);
|
|
1542
1356
|
// Reset the test providers and the fake async zone before each test.
|
|
1543
1357
|
if (_global$1.beforeEach) {
|
|
@@ -1649,10 +1463,6 @@ function ensureDocument() {
|
|
|
1649
1463
|
// https://github.com/angular/angular/blob/7cf5e95ac9f0f2648beebf0d5bd9056b79946970/packages/platform-browser/src/dom/events/dom_events.ts#L112-L132
|
|
1650
1464
|
// It fails with Domino with TypeError: Cannot assign to read only property
|
|
1651
1465
|
// 'stopImmediatePropagation' of object '#<Event>'
|
|
1652
|
-
// Trick to avoid Event patching from
|
|
1653
|
-
// https://github.com/angular/angular/blob/7cf5e95ac9f0f2648beebf0d5bd9056b79946970/packages/platform-browser/src/dom/events/dom_events.ts#L112-L132
|
|
1654
|
-
// It fails with Domino with TypeError: Cannot assign to read only property
|
|
1655
|
-
// 'stopImmediatePropagation' of object '#<Event>'
|
|
1656
1466
|
global.Event = null;
|
|
1657
1467
|
savedNode = global.Node;
|
|
1658
1468
|
global.Node = domino.impl.Node;
|
|
@@ -1694,6 +1504,11 @@ if (typeof afterEach == 'function')
|
|
|
1694
1504
|
* Use of this source code is governed by an MIT-style license that can be
|
|
1695
1505
|
* found in the LICENSE file at https://angular.io/license
|
|
1696
1506
|
*/
|
|
1507
|
+
/**
|
|
1508
|
+
* @module
|
|
1509
|
+
* @description
|
|
1510
|
+
* Entry point for all public APIs of the core/testing package.
|
|
1511
|
+
*/
|
|
1697
1512
|
|
|
1698
1513
|
/**
|
|
1699
1514
|
* @license
|
|
@@ -1702,6 +1517,11 @@ if (typeof afterEach == 'function')
|
|
|
1702
1517
|
* Use of this source code is governed by an MIT-style license that can be
|
|
1703
1518
|
* found in the LICENSE file at https://angular.io/license
|
|
1704
1519
|
*/
|
|
1520
|
+
/**
|
|
1521
|
+
* @module
|
|
1522
|
+
* @description
|
|
1523
|
+
* Entry point for all public APIs of this package.
|
|
1524
|
+
*/
|
|
1705
1525
|
|
|
1706
1526
|
// This file only reexports content of the `src` folder. Keep it that way.
|
|
1707
1527
|
|
|
@@ -1712,6 +1532,10 @@ if (typeof afterEach == 'function')
|
|
|
1712
1532
|
* Use of this source code is governed by an MIT-style license that can be
|
|
1713
1533
|
* found in the LICENSE file at https://angular.io/license
|
|
1714
1534
|
*/
|
|
1535
|
+
// This file is not used to build this module. It is only used during editing
|
|
1536
|
+
// by the TypeScript language service and during build for verification. `ngc`
|
|
1537
|
+
// replaces this file with production index.ts when it rewrites private symbol
|
|
1538
|
+
// names.
|
|
1715
1539
|
|
|
1716
1540
|
/**
|
|
1717
1541
|
* Generated bundle index. Do not edit.
|