1
|
/**
|
2
|
* @license Angular v4.4.6
|
3
|
* (c) 2010-2017 Google, Inc. https://angular.io/
|
4
|
* License: MIT
|
5
|
*/
|
6
|
(function (global, factory) {
|
7
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core')) :
|
8
|
typeof define === 'function' && define.amd ? define(['exports', '@angular/core'], factory) :
|
9
|
(factory((global.ng = global.ng || {}, global.ng.core = global.ng.core || {}, global.ng.core.testing = global.ng.core.testing || {}),global.ng.core));
|
10
|
}(this, (function (exports,_angular_core) { 'use strict';
|
11
|
|
12
|
/*! *****************************************************************************
|
13
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
14
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
15
|
this file except in compliance with the License. You may obtain a copy of the
|
16
|
License at http://www.apache.org/licenses/LICENSE-2.0
|
17
|
|
18
|
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
19
|
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
20
|
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
21
|
MERCHANTABLITY OR NON-INFRINGEMENT.
|
22
|
|
23
|
See the Apache Version 2.0 License for specific language governing permissions
|
24
|
and limitations under the License.
|
25
|
***************************************************************************** */
|
26
|
/* global Reflect, Promise */
|
27
|
|
28
|
var extendStatics = Object.setPrototypeOf ||
|
29
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
30
|
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
31
|
|
32
|
function __extends(d, b) {
|
33
|
extendStatics(d, b);
|
34
|
function __() { this.constructor = d; }
|
35
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
36
|
}
|
37
|
|
38
|
/**
|
39
|
* @license Angular v4.4.6
|
40
|
* (c) 2010-2017 Google, Inc. https://angular.io/
|
41
|
* License: MIT
|
42
|
*/
|
43
|
/**
|
44
|
* @license
|
45
|
* Copyright Google Inc. All Rights Reserved.
|
46
|
*
|
47
|
* Use of this source code is governed by an MIT-style license that can be
|
48
|
* found in the LICENSE file at https://angular.io/license
|
49
|
*/
|
50
|
var _global = (typeof window === 'undefined' ? global : window);
|
51
|
/**
|
52
|
* Wraps a test function in an asynchronous test zone. The test will automatically
|
53
|
* complete when all asynchronous calls within this zone are done. Can be used
|
54
|
* to wrap an {@link inject} call.
|
55
|
*
|
56
|
* Example:
|
57
|
*
|
58
|
* ```
|
59
|
* it('...', async(inject([AClass], (object) => {
|
60
|
* object.doSomething.then(() => {
|
61
|
* expect(...);
|
62
|
* })
|
63
|
* });
|
64
|
* ```
|
65
|
*
|
66
|
* @stable
|
67
|
*/
|
68
|
function async(fn) {
|
69
|
// If we're running using the Jasmine test framework, adapt to call the 'done'
|
70
|
// function when asynchronous activity is finished.
|
71
|
if (_global.jasmine) {
|
72
|
// Not using an arrow function to preserve context passed from call site
|
73
|
return function (done) {
|
74
|
if (!done) {
|
75
|
// if we run beforeEach in @angular/core/testing/testing_internal then we get no done
|
76
|
// fake it here and assume sync.
|
77
|
done = function () { };
|
78
|
done.fail = function (e) { throw e; };
|
79
|
}
|
80
|
runInTestZone(fn, this, done, function (err) {
|
81
|
if (typeof err === 'string') {
|
82
|
return done.fail(new Error(err));
|
83
|
}
|
84
|
else {
|
85
|
done.fail(err);
|
86
|
}
|
87
|
});
|
88
|
};
|
89
|
}
|
90
|
// Otherwise, return a promise which will resolve when asynchronous activity
|
91
|
// is finished. This will be correctly consumed by the Mocha framework with
|
92
|
// it('...', async(myFn)); or can be used in a custom framework.
|
93
|
// Not using an arrow function to preserve context passed from call site
|
94
|
return function () {
|
95
|
var _this = this;
|
96
|
return new Promise(function (finishCallback, failCallback) {
|
97
|
runInTestZone(fn, _this, finishCallback, failCallback);
|
98
|
});
|
99
|
};
|
100
|
}
|
101
|
function runInTestZone(fn, context, finishCallback, failCallback) {
|
102
|
var currentZone = Zone.current;
|
103
|
var AsyncTestZoneSpec = Zone['AsyncTestZoneSpec'];
|
104
|
if (AsyncTestZoneSpec === undefined) {
|
105
|
throw new Error('AsyncTestZoneSpec is needed for the async() test helper but could not be found. ' +
|
106
|
'Please make sure that your environment includes zone.js/dist/async-test.js');
|
107
|
}
|
108
|
var ProxyZoneSpec = Zone['ProxyZoneSpec'];
|
109
|
if (ProxyZoneSpec === undefined) {
|
110
|
throw new Error('ProxyZoneSpec is needed for the async() test helper but could not be found. ' +
|
111
|
'Please make sure that your environment includes zone.js/dist/proxy.js');
|
112
|
}
|
113
|
var proxyZoneSpec = ProxyZoneSpec.get();
|
114
|
ProxyZoneSpec.assertPresent();
|
115
|
// We need to create the AsyncTestZoneSpec outside the ProxyZone.
|
116
|
// If we do it in ProxyZone then we will get to infinite recursion.
|
117
|
var proxyZone = Zone.current.getZoneWith('ProxyZoneSpec');
|
118
|
var previousDelegate = proxyZoneSpec.getDelegate();
|
119
|
proxyZone.parent.run(function () {
|
120
|
var testZoneSpec = new AsyncTestZoneSpec(function () {
|
121
|
// Need to restore the original zone.
|
122
|
currentZone.run(function () {
|
123
|
if (proxyZoneSpec.getDelegate() == testZoneSpec) {
|
124
|
// Only reset the zone spec if it's sill this one. Otherwise, assume it's OK.
|
125
|
proxyZoneSpec.setDelegate(previousDelegate);
|
126
|
}
|
127
|
finishCallback();
|
128
|
});
|
129
|
}, function (error) {
|
130
|
// Need to restore the original zone.
|
131
|
currentZone.run(function () {
|
132
|
if (proxyZoneSpec.getDelegate() == testZoneSpec) {
|
133
|
// Only reset the zone spec if it's sill this one. Otherwise, assume it's OK.
|
134
|
proxyZoneSpec.setDelegate(previousDelegate);
|
135
|
}
|
136
|
failCallback(error);
|
137
|
});
|
138
|
}, 'test');
|
139
|
proxyZoneSpec.setDelegate(testZoneSpec);
|
140
|
});
|
141
|
return Zone.current.runGuarded(fn, context);
|
142
|
}
|
143
|
/**
|
144
|
* @license
|
145
|
* Copyright Google Inc. All Rights Reserved.
|
146
|
*
|
147
|
* Use of this source code is governed by an MIT-style license that can be
|
148
|
* found in the LICENSE file at https://angular.io/license
|
149
|
*/
|
150
|
/**
|
151
|
* Fixture for debugging and testing a component.
|
152
|
*
|
153
|
* @stable
|
154
|
*/
|
155
|
var ComponentFixture = (function () {
|
156
|
function ComponentFixture(componentRef, ngZone, _autoDetect) {
|
157
|
var _this = this;
|
158
|
this.componentRef = componentRef;
|
159
|
this.ngZone = ngZone;
|
160
|
this._autoDetect = _autoDetect;
|
161
|
this._isStable = true;
|
162
|
this._isDestroyed = false;
|
163
|
this._resolve = null;
|
164
|
this._promise = null;
|
165
|
this._onUnstableSubscription = null;
|
166
|
this._onStableSubscription = null;
|
167
|
this._onMicrotaskEmptySubscription = null;
|
168
|
this._onErrorSubscription = null;
|
169
|
this.changeDetectorRef = componentRef.changeDetectorRef;
|
170
|
this.elementRef = componentRef.location;
|
171
|
this.debugElement = _angular_core.getDebugNode(this.elementRef.nativeElement);
|
172
|
this.componentInstance = componentRef.instance;
|
173
|
this.nativeElement = this.elementRef.nativeElement;
|
174
|
this.componentRef = componentRef;
|
175
|
this.ngZone = ngZone;
|
176
|
if (ngZone) {
|
177
|
// Create subscriptions outside the NgZone so that the callbacks run oustide
|
178
|
// of NgZone.
|
179
|
ngZone.runOutsideAngular(function () {
|
180
|
_this._onUnstableSubscription =
|
181
|
ngZone.onUnstable.subscribe({ next: function () { _this._isStable = false; } });
|
182
|
_this._onMicrotaskEmptySubscription = ngZone.onMicrotaskEmpty.subscribe({
|
183
|
next: function () {
|
184
|
if (_this._autoDetect) {
|
185
|
// Do a change detection run with checkNoChanges set to true to check
|
186
|
// there are no changes on the second run.
|
187
|
_this.detectChanges(true);
|
188
|
}
|
189
|
}
|
190
|
});
|
191
|
_this._onStableSubscription = ngZone.onStable.subscribe({
|
192
|
next: function () {
|
193
|
_this._isStable = true;
|
194
|
// Check whether there is a pending whenStable() completer to resolve.
|
195
|
if (_this._promise !== null) {
|
196
|
// If so check whether there are no pending macrotasks before resolving.
|
197
|
// Do this check in the next tick so that ngZone gets a chance to update the state of
|
198
|
// pending macrotasks.
|
199
|
scheduleMicroTask(function () {
|
200
|
if (!ngZone.hasPendingMacrotasks) {
|
201
|
if (_this._promise !== null) {
|
202
|
_this._resolve(true);
|
203
|
_this._resolve = null;
|
204
|
_this._promise = null;
|
205
|
}
|
206
|
}
|
207
|
});
|
208
|
}
|
209
|
}
|
210
|
});
|
211
|
_this._onErrorSubscription =
|
212
|
ngZone.onError.subscribe({ next: function (error) { throw error; } });
|
213
|
});
|
214
|
}
|
215
|
}
|
216
|
ComponentFixture.prototype._tick = function (checkNoChanges) {
|
217
|
this.changeDetectorRef.detectChanges();
|
218
|
if (checkNoChanges) {
|
219
|
this.checkNoChanges();
|
220
|
}
|
221
|
};
|
222
|
/**
|
223
|
* Trigger a change detection cycle for the component.
|
224
|
*/
|
225
|
ComponentFixture.prototype.detectChanges = function (checkNoChanges) {
|
226
|
var _this = this;
|
227
|
if (checkNoChanges === void 0) { checkNoChanges = true; }
|
228
|
if (this.ngZone != null) {
|
229
|
// Run the change detection inside the NgZone so that any async tasks as part of the change
|
230
|
// detection are captured by the zone and can be waited for in isStable.
|
231
|
this.ngZone.run(function () { _this._tick(checkNoChanges); });
|
232
|
}
|
233
|
else {
|
234
|
// Running without zone. Just do the change detection.
|
235
|
this._tick(checkNoChanges);
|
236
|
}
|
237
|
};
|
238
|
/**
|
239
|
* Do a change detection run to make sure there were no changes.
|
240
|
*/
|
241
|
ComponentFixture.prototype.checkNoChanges = function () { this.changeDetectorRef.checkNoChanges(); };
|
242
|
/**
|
243
|
* Set whether the fixture should autodetect changes.
|
244
|
*
|
245
|
* Also runs detectChanges once so that any existing change is detected.
|
246
|
*/
|
247
|
ComponentFixture.prototype.autoDetectChanges = function (autoDetect) {
|
248
|
if (autoDetect === void 0) { autoDetect = true; }
|
249
|
if (this.ngZone == null) {
|
250
|
throw new Error('Cannot call autoDetectChanges when ComponentFixtureNoNgZone is set');
|
251
|
}
|
252
|
this._autoDetect = autoDetect;
|
253
|
this.detectChanges();
|
254
|
};
|
255
|
/**
|
256
|
* Return whether the fixture is currently stable or has async tasks that have not been completed
|
257
|
* yet.
|
258
|
*/
|
259
|
ComponentFixture.prototype.isStable = function () { return this._isStable && !this.ngZone.hasPendingMacrotasks; };
|
260
|
/**
|
261
|
* Get a promise that resolves when the fixture is stable.
|
262
|
*
|
263
|
* This can be used to resume testing after events have triggered asynchronous activity or
|
264
|
* asynchronous change detection.
|
265
|
*/
|
266
|
ComponentFixture.prototype.whenStable = function () {
|
267
|
var _this = this;
|
268
|
if (this.isStable()) {
|
269
|
return Promise.resolve(false);
|
270
|
}
|
271
|
else if (this._promise !== null) {
|
272
|
return this._promise;
|
273
|
}
|
274
|
else {
|
275
|
this._promise = new Promise(function (res) { _this._resolve = res; });
|
276
|
return this._promise;
|
277
|
}
|
278
|
};
|
279
|
ComponentFixture.prototype._getRenderer = function () {
|
280
|
if (this._renderer === undefined) {
|
281
|
this._renderer = this.componentRef.injector.get(_angular_core.RendererFactory2, null);
|
282
|
}
|
283
|
return this._renderer;
|
284
|
};
|
285
|
/**
|
286
|
* Get a promise that resolves when the ui state is stable following animations.
|
287
|
*/
|
288
|
ComponentFixture.prototype.whenRenderingDone = function () {
|
289
|
var renderer = this._getRenderer();
|
290
|
if (renderer && renderer.whenRenderingDone) {
|
291
|
return renderer.whenRenderingDone();
|
292
|
}
|
293
|
return this.whenStable();
|
294
|
};
|
295
|
/**
|
296
|
* Trigger component destruction.
|
297
|
*/
|
298
|
ComponentFixture.prototype.destroy = function () {
|
299
|
if (!this._isDestroyed) {
|
300
|
this.componentRef.destroy();
|
301
|
if (this._onUnstableSubscription != null) {
|
302
|
this._onUnstableSubscription.unsubscribe();
|
303
|
this._onUnstableSubscription = null;
|
304
|
}
|
305
|
if (this._onStableSubscription != null) {
|
306
|
this._onStableSubscription.unsubscribe();
|
307
|
this._onStableSubscription = null;
|
308
|
}
|
309
|
if (this._onMicrotaskEmptySubscription != null) {
|
310
|
this._onMicrotaskEmptySubscription.unsubscribe();
|
311
|
this._onMicrotaskEmptySubscription = null;
|
312
|
}
|
313
|
if (this._onErrorSubscription != null) {
|
314
|
this._onErrorSubscription.unsubscribe();
|
315
|
this._onErrorSubscription = null;
|
316
|
}
|
317
|
this._isDestroyed = true;
|
318
|
}
|
319
|
};
|
320
|
return ComponentFixture;
|
321
|
}());
|
322
|
function scheduleMicroTask(fn) {
|
323
|
Zone.current.scheduleMicroTask('scheduleMicrotask', fn);
|
324
|
}
|
325
|
/**
|
326
|
* @license
|
327
|
* Copyright Google Inc. All Rights Reserved.
|
328
|
*
|
329
|
* Use of this source code is governed by an MIT-style license that can be
|
330
|
* found in the LICENSE file at https://angular.io/license
|
331
|
*/
|
332
|
var FakeAsyncTestZoneSpec = Zone['FakeAsyncTestZoneSpec'];
|
333
|
var ProxyZoneSpec = Zone['ProxyZoneSpec'];
|
334
|
var _fakeAsyncTestZoneSpec = null;
|
335
|
/**
|
336
|
* Clears out the shared fake async zone for a test.
|
337
|
* To be called in a global `beforeEach`.
|
338
|
*
|
339
|
* @experimental
|
340
|
*/
|
341
|
function resetFakeAsyncZone() {
|
342
|
_fakeAsyncTestZoneSpec = null;
|
343
|
ProxyZoneSpec.assertPresent().resetDelegate();
|
344
|
}
|
345
|
var _inFakeAsyncCall = false;
|
346
|
/**
|
347
|
* Wraps a function to be executed in the fakeAsync zone:
|
348
|
* - microtasks are manually executed by calling `flushMicrotasks()`,
|
349
|
* - timers are synchronous, `tick()` simulates the asynchronous passage of time.
|
350
|
*
|
351
|
* If there are any pending timers at the end of the function, an exception will be thrown.
|
352
|
*
|
353
|
* Can be used to wrap inject() calls.
|
354
|
*
|
355
|
* ## Example
|
356
|
*
|
357
|
* {@example testing/ts/fake_async.ts region='basic'}
|
358
|
*
|
359
|
* @param fn
|
360
|
* @returns {Function} The function wrapped to be executed in the fakeAsync zone
|
361
|
*
|
362
|
* @experimental
|
363
|
*/
|
364
|
function fakeAsync(fn) {
|
365
|
// Not using an arrow function to preserve context passed from call site
|
366
|
return function () {
|
367
|
var args = [];
|
368
|
for (var _i = 0; _i < arguments.length; _i++) {
|
369
|
args[_i] = arguments[_i];
|
370
|
}
|
371
|
var proxyZoneSpec = ProxyZoneSpec.assertPresent();
|
372
|
if (_inFakeAsyncCall) {
|
373
|
throw new Error('fakeAsync() calls can not be nested');
|
374
|
}
|
375
|
_inFakeAsyncCall = true;
|
376
|
try {
|
377
|
if (!_fakeAsyncTestZoneSpec) {
|
378
|
if (proxyZoneSpec.getDelegate() instanceof FakeAsyncTestZoneSpec) {
|
379
|
throw new Error('fakeAsync() calls can not be nested');
|
380
|
}
|
381
|
_fakeAsyncTestZoneSpec = new FakeAsyncTestZoneSpec();
|
382
|
}
|
383
|
var res = void 0;
|
384
|
var lastProxyZoneSpec = proxyZoneSpec.getDelegate();
|
385
|
proxyZoneSpec.setDelegate(_fakeAsyncTestZoneSpec);
|
386
|
try {
|
387
|
res = fn.apply(this, args);
|
388
|
flushMicrotasks();
|
389
|
}
|
390
|
finally {
|
391
|
proxyZoneSpec.setDelegate(lastProxyZoneSpec);
|
392
|
}
|
393
|
if (_fakeAsyncTestZoneSpec.pendingPeriodicTimers.length > 0) {
|
394
|
throw new Error(_fakeAsyncTestZoneSpec.pendingPeriodicTimers.length + " " +
|
395
|
"periodic timer(s) still in the queue.");
|
396
|
}
|
397
|
if (_fakeAsyncTestZoneSpec.pendingTimers.length > 0) {
|
398
|
throw new Error(_fakeAsyncTestZoneSpec.pendingTimers.length + " timer(s) still in the queue.");
|
399
|
}
|
400
|
return res;
|
401
|
}
|
402
|
finally {
|
403
|
_inFakeAsyncCall = false;
|
404
|
resetFakeAsyncZone();
|
405
|
}
|
406
|
};
|
407
|
}
|
408
|
function _getFakeAsyncZoneSpec() {
|
409
|
if (_fakeAsyncTestZoneSpec == null) {
|
410
|
throw new Error('The code should be running in the fakeAsync zone to call this function');
|
411
|
}
|
412
|
return _fakeAsyncTestZoneSpec;
|
413
|
}
|
414
|
/**
|
415
|
* Simulates the asynchronous passage of time for the timers in the fakeAsync zone.
|
416
|
*
|
417
|
* The microtasks queue is drained at the very start of this function and after any timer callback
|
418
|
* has been executed.
|
419
|
*
|
420
|
* ## Example
|
421
|
*
|
422
|
* {@example testing/ts/fake_async.ts region='basic'}
|
423
|
*
|
424
|
* @experimental
|
425
|
*/
|
426
|
function tick(millis) {
|
427
|
if (millis === void 0) { millis = 0; }
|
428
|
_getFakeAsyncZoneSpec().tick(millis);
|
429
|
}
|
430
|
/**
|
431
|
* Simulates the asynchronous passage of time for the timers in the fakeAsync zone by
|
432
|
* draining the macrotask queue until it is empty. The returned value is the milliseconds
|
433
|
* of time that would have been elapsed.
|
434
|
*
|
435
|
* @param maxTurns
|
436
|
* @returns {number} The simulated time elapsed, in millis.
|
437
|
*
|
438
|
* @experimental
|
439
|
*/
|
440
|
function flush(maxTurns) {
|
441
|
return _getFakeAsyncZoneSpec().flush(maxTurns);
|
442
|
}
|
443
|
/**
|
444
|
* Discard all remaining periodic tasks.
|
445
|
*
|
446
|
* @experimental
|
447
|
*/
|
448
|
function discardPeriodicTasks() {
|
449
|
var zoneSpec = _getFakeAsyncZoneSpec();
|
450
|
var pendingTimers = zoneSpec.pendingPeriodicTimers;
|
451
|
zoneSpec.pendingPeriodicTimers.length = 0;
|
452
|
}
|
453
|
/**
|
454
|
* Flush any pending microtasks.
|
455
|
*
|
456
|
* @experimental
|
457
|
*/
|
458
|
function flushMicrotasks() {
|
459
|
_getFakeAsyncZoneSpec().flushMicrotasks();
|
460
|
}
|
461
|
/**
|
462
|
* @license
|
463
|
* Copyright Google Inc. All Rights Reserved.
|
464
|
*
|
465
|
* Use of this source code is governed by an MIT-style license that can be
|
466
|
* found in the LICENSE file at https://angular.io/license
|
467
|
*/
|
468
|
/**
|
469
|
* Injectable completer that allows signaling completion of an asynchronous test. Used internally.
|
470
|
*/
|
471
|
/**
|
472
|
* @license
|
473
|
* Copyright Google Inc. All Rights Reserved.
|
474
|
*
|
475
|
* Use of this source code is governed by an MIT-style license that can be
|
476
|
* found in the LICENSE file at https://angular.io/license
|
477
|
*/ var AsyncTestCompleter = (function () {
|
478
|
function AsyncTestCompleter() {
|
479
|
var _this = this;
|
480
|
this._promise = new Promise(function (res, rej) {
|
481
|
_this._resolve = res;
|
482
|
_this._reject = rej;
|
483
|
});
|
484
|
}
|
485
|
AsyncTestCompleter.prototype.done = function (value) { this._resolve(value); };
|
486
|
AsyncTestCompleter.prototype.fail = function (error, stackTrace) { this._reject(error); };
|
487
|
Object.defineProperty(AsyncTestCompleter.prototype, "promise", {
|
488
|
get: function () { return this._promise; },
|
489
|
enumerable: true,
|
490
|
configurable: true
|
491
|
});
|
492
|
return AsyncTestCompleter;
|
493
|
}());
|
494
|
/**
|
495
|
* @license
|
496
|
* Copyright Google Inc. All Rights Reserved.
|
497
|
*
|
498
|
* Use of this source code is governed by an MIT-style license that can be
|
499
|
* found in the LICENSE file at https://angular.io/license
|
500
|
*/
|
501
|
function unimplemented() {
|
502
|
throw Error('unimplemented');
|
503
|
}
|
504
|
/**
|
505
|
* Special interface to the compiler only used by testing
|
506
|
*
|
507
|
* @experimental
|
508
|
*/
|
509
|
var TestingCompiler = (function (_super) {
|
510
|
__extends(TestingCompiler, _super);
|
511
|
function TestingCompiler() {
|
512
|
return _super !== null && _super.apply(this, arguments) || this;
|
513
|
}
|
514
|
Object.defineProperty(TestingCompiler.prototype, "injector", {
|
515
|
get: function () { throw unimplemented(); },
|
516
|
enumerable: true,
|
517
|
configurable: true
|
518
|
});
|
519
|
TestingCompiler.prototype.overrideModule = function (module, overrides) {
|
520
|
throw unimplemented();
|
521
|
};
|
522
|
TestingCompiler.prototype.overrideDirective = function (directive, overrides) {
|
523
|
throw unimplemented();
|
524
|
};
|
525
|
TestingCompiler.prototype.overrideComponent = function (component, overrides) {
|
526
|
throw unimplemented();
|
527
|
};
|
528
|
TestingCompiler.prototype.overridePipe = function (directive, overrides) {
|
529
|
throw unimplemented();
|
530
|
};
|
531
|
/**
|
532
|
* Allows to pass the compile summary from AOT compilation to the JIT compiler,
|
533
|
* so that it can use the code generated by AOT.
|
534
|
*/
|
535
|
TestingCompiler.prototype.loadAotSummaries = function (summaries) { throw unimplemented(); };
|
536
|
/**
|
537
|
* Gets the component factory for the given component.
|
538
|
* This assumes that the component has been compiled before calling this call using
|
539
|
* `compileModuleAndAllComponents*`.
|
540
|
*/
|
541
|
TestingCompiler.prototype.getComponentFactory = function (component) { throw unimplemented(); };
|
542
|
return TestingCompiler;
|
543
|
}(_angular_core.Compiler));
|
544
|
/**
|
545
|
* A factory for creating a Compiler
|
546
|
*
|
547
|
* @experimental
|
548
|
*/
|
549
|
var TestingCompilerFactory = (function () {
|
550
|
function TestingCompilerFactory() {
|
551
|
}
|
552
|
return TestingCompilerFactory;
|
553
|
}());
|
554
|
/**
|
555
|
* @license
|
556
|
* Copyright Google Inc. All Rights Reserved.
|
557
|
*
|
558
|
* Use of this source code is governed by an MIT-style license that can be
|
559
|
* found in the LICENSE file at https://angular.io/license
|
560
|
*/
|
561
|
var UNDEFINED = new Object();
|
562
|
/**
|
563
|
* An abstract class for inserting the root test component element in a platform independent way.
|
564
|
*
|
565
|
* @experimental
|
566
|
*/
|
567
|
var TestComponentRenderer = (function () {
|
568
|
function TestComponentRenderer() {
|
569
|
}
|
570
|
TestComponentRenderer.prototype.insertRootElement = function (rootElementId) { };
|
571
|
return TestComponentRenderer;
|
572
|
}());
|
573
|
var _nextRootElementId = 0;
|
574
|
/**
|
575
|
* @experimental
|
576
|
*/
|
577
|
var ComponentFixtureAutoDetect = new _angular_core.InjectionToken('ComponentFixtureAutoDetect');
|
578
|
/**
|
579
|
* @experimental
|
580
|
*/
|
581
|
var ComponentFixtureNoNgZone = new _angular_core.InjectionToken('ComponentFixtureNoNgZone');
|
582
|
/**
|
583
|
* @whatItDoes Configures and initializes environment for unit testing and provides methods for
|
584
|
* creating components and services in unit tests.
|
585
|
* @description
|
586
|
*
|
587
|
* TestBed is the primary api for writing unit tests for Angular applications and libraries.
|
588
|
*
|
589
|
* @stable
|
590
|
*/
|
591
|
var TestBed = (function () {
|
592
|
function TestBed() {
|
593
|
this._instantiated = false;
|
594
|
this._compiler = null;
|
595
|
this._moduleRef = null;
|
596
|
this._moduleFactory = null;
|
597
|
this._compilerOptions = [];
|
598
|
this._moduleOverrides = [];
|
599
|
this._componentOverrides = [];
|
600
|
this._directiveOverrides = [];
|
601
|
this._pipeOverrides = [];
|
602
|
this._providers = [];
|
603
|
this._declarations = [];
|
604
|
this._imports = [];
|
605
|
this._schemas = [];
|
606
|
this._activeFixtures = [];
|
607
|
this._aotSummaries = function () { return []; };
|
608
|
this.platform = null;
|
609
|
this.ngModule = null;
|
610
|
}
|
611
|
/**
|
612
|
* Initialize the environment for testing with a compiler factory, a PlatformRef, and an
|
613
|
* angular module. These are common to every test in the suite.
|
614
|
*
|
615
|
* This may only be called once, to set up the common providers for the current test
|
616
|
* suite on the current platform. If you absolutely need to change the providers,
|
617
|
* first use `resetTestEnvironment`.
|
618
|
*
|
619
|
* Test modules and platforms for individual platforms are available from
|
620
|
* '@angular/<platform_name>/testing'.
|
621
|
*
|
622
|
* @experimental
|
623
|
*/
|
624
|
TestBed.initTestEnvironment = function (ngModule, platform, aotSummaries) {
|
625
|
var testBed = getTestBed();
|
626
|
testBed.initTestEnvironment(ngModule, platform, aotSummaries);
|
627
|
return testBed;
|
628
|
};
|
629
|
/**
|
630
|
* Reset the providers for the test injector.
|
631
|
*
|
632
|
* @experimental
|
633
|
*/
|
634
|
TestBed.resetTestEnvironment = function () { getTestBed().resetTestEnvironment(); };
|
635
|
TestBed.resetTestingModule = function () {
|
636
|
getTestBed().resetTestingModule();
|
637
|
return TestBed;
|
638
|
};
|
639
|
/**
|
640
|
* Allows overriding default compiler providers and settings
|
641
|
* which are defined in test_injector.js
|
642
|
*/
|
643
|
TestBed.configureCompiler = function (config) {
|
644
|
getTestBed().configureCompiler(config);
|
645
|
return TestBed;
|
646
|
};
|
647
|
/**
|
648
|
* Allows overriding default providers, directives, pipes, modules of the test injector,
|
649
|
* which are defined in test_injector.js
|
650
|
*/
|
651
|
TestBed.configureTestingModule = function (moduleDef) {
|
652
|
getTestBed().configureTestingModule(moduleDef);
|
653
|
return TestBed;
|
654
|
};
|
655
|
/**
|
656
|
* Compile components with a `templateUrl` for the test's NgModule.
|
657
|
* It is necessary to call this function
|
658
|
* as fetching urls is asynchronous.
|
659
|
*/
|
660
|
TestBed.compileComponents = function () { return getTestBed().compileComponents(); };
|
661
|
TestBed.overrideModule = function (ngModule, override) {
|
662
|
getTestBed().overrideModule(ngModule, override);
|
663
|
return TestBed;
|
664
|
};
|
665
|
TestBed.overrideComponent = function (component, override) {
|
666
|
getTestBed().overrideComponent(component, override);
|
667
|
return TestBed;
|
668
|
};
|
669
|
TestBed.overrideDirective = function (directive, override) {
|
670
|
getTestBed().overrideDirective(directive, override);
|
671
|
return TestBed;
|
672
|
};
|
673
|
TestBed.overridePipe = function (pipe, override) {
|
674
|
getTestBed().overridePipe(pipe, override);
|
675
|
return TestBed;
|
676
|
};
|
677
|
TestBed.overrideTemplate = function (component, template) {
|
678
|
getTestBed().overrideComponent(component, { set: { template: template, templateUrl: null } });
|
679
|
return TestBed;
|
680
|
};
|
681
|
TestBed.overrideProvider = function (token, provider) {
|
682
|
getTestBed().overrideProvider(token, provider);
|
683
|
return TestBed;
|
684
|
};
|
685
|
TestBed.deprecatedOverrideProvider = function (token, provider) {
|
686
|
getTestBed().deprecatedOverrideProvider(token, provider);
|
687
|
return TestBed;
|
688
|
};
|
689
|
TestBed.get = function (token, notFoundValue) {
|
690
|
if (notFoundValue === void 0) { notFoundValue = _angular_core.Injector.THROW_IF_NOT_FOUND; }
|
691
|
return getTestBed().get(token, notFoundValue);
|
692
|
};
|
693
|
TestBed.createComponent = function (component) {
|
694
|
return getTestBed().createComponent(component);
|
695
|
};
|
696
|
/**
|
697
|
* Initialize the environment for testing with a compiler factory, a PlatformRef, and an
|
698
|
* angular module. These are common to every test in the suite.
|
699
|
*
|
700
|
* This may only be called once, to set up the common providers for the current test
|
701
|
* suite on the current platform. If you absolutely need to change the providers,
|
702
|
* first use `resetTestEnvironment`.
|
703
|
*
|
704
|
* Test modules and platforms for individual platforms are available from
|
705
|
* '@angular/<platform_name>/testing'.
|
706
|
*
|
707
|
* @experimental
|
708
|
*/
|
709
|
TestBed.prototype.initTestEnvironment = function (ngModule, platform, aotSummaries) {
|
710
|
if (this.platform || this.ngModule) {
|
711
|
throw new Error('Cannot set base providers because it has already been called');
|
712
|
}
|
713
|
this.platform = platform;
|
714
|
this.ngModule = ngModule;
|
715
|
if (aotSummaries) {
|
716
|
this._aotSummaries = aotSummaries;
|
717
|
}
|
718
|
};
|
719
|
/**
|
720
|
* Reset the providers for the test injector.
|
721
|
*
|
722
|
* @experimental
|
723
|
*/
|
724
|
TestBed.prototype.resetTestEnvironment = function () {
|
725
|
this.resetTestingModule();
|
726
|
this.platform = null;
|
727
|
this.ngModule = null;
|
728
|
this._aotSummaries = function () { return []; };
|
729
|
};
|
730
|
TestBed.prototype.resetTestingModule = function () {
|
731
|
_angular_core.ɵclearProviderOverrides();
|
732
|
this._compiler = null;
|
733
|
this._moduleOverrides = [];
|
734
|
this._componentOverrides = [];
|
735
|
this._directiveOverrides = [];
|
736
|
this._pipeOverrides = [];
|
737
|
this._moduleRef = null;
|
738
|
this._moduleFactory = null;
|
739
|
this._compilerOptions = [];
|
740
|
this._providers = [];
|
741
|
this._declarations = [];
|
742
|
this._imports = [];
|
743
|
this._schemas = [];
|
744
|
this._instantiated = false;
|
745
|
this._activeFixtures.forEach(function (fixture) {
|
746
|
try {
|
747
|
fixture.destroy();
|
748
|
}
|
749
|
catch (e) {
|
750
|
console.error('Error during cleanup of component', fixture.componentInstance);
|
751
|
}
|
752
|
});
|
753
|
this._activeFixtures = [];
|
754
|
};
|
755
|
TestBed.prototype.configureCompiler = function (config) {
|
756
|
this._assertNotInstantiated('TestBed.configureCompiler', 'configure the compiler');
|
757
|
this._compilerOptions.push(config);
|
758
|
};
|
759
|
TestBed.prototype.configureTestingModule = function (moduleDef) {
|
760
|
this._assertNotInstantiated('TestBed.configureTestingModule', 'configure the test module');
|
761
|
if (moduleDef.providers) {
|
762
|
(_a = this._providers).push.apply(_a, moduleDef.providers);
|
763
|
}
|
764
|
if (moduleDef.declarations) {
|
765
|
(_b = this._declarations).push.apply(_b, moduleDef.declarations);
|
766
|
}
|
767
|
if (moduleDef.imports) {
|
768
|
(_c = this._imports).push.apply(_c, moduleDef.imports);
|
769
|
}
|
770
|
if (moduleDef.schemas) {
|
771
|
(_d = this._schemas).push.apply(_d, moduleDef.schemas);
|
772
|
}
|
773
|
var _a, _b, _c, _d;
|
774
|
};
|
775
|
TestBed.prototype.compileComponents = function () {
|
776
|
var _this = this;
|
777
|
if (this._moduleFactory || this._instantiated) {
|
778
|
return Promise.resolve(null);
|
779
|
}
|
780
|
var moduleType = this._createCompilerAndModule();
|
781
|
return this._compiler.compileModuleAndAllComponentsAsync(moduleType)
|
782
|
.then(function (moduleAndComponentFactories) {
|
783
|
_this._moduleFactory = moduleAndComponentFactories.ngModuleFactory;
|
784
|
});
|
785
|
};
|
786
|
TestBed.prototype._initIfNeeded = function () {
|
787
|
if (this._instantiated) {
|
788
|
return;
|
789
|
}
|
790
|
if (!this._moduleFactory) {
|
791
|
try {
|
792
|
var moduleType = this._createCompilerAndModule();
|
793
|
this._moduleFactory =
|
794
|
this._compiler.compileModuleAndAllComponentsSync(moduleType).ngModuleFactory;
|
795
|
}
|
796
|
catch (e) {
|
797
|
if (getComponentType(e)) {
|
798
|
throw new Error("This test module uses the component " + _angular_core.ɵstringify(getComponentType(e)) + " which is using a \"templateUrl\" or \"styleUrls\", but they were never compiled. " +
|
799
|
"Please call \"TestBed.compileComponents\" before your test.");
|
800
|
}
|
801
|
else {
|
802
|
throw e;
|
803
|
}
|
804
|
}
|
805
|
}
|
806
|
var ngZone = new _angular_core.NgZone({ enableLongStackTrace: true });
|
807
|
var ngZoneInjector = _angular_core.ReflectiveInjector.resolveAndCreate([{ provide: _angular_core.NgZone, useValue: ngZone }], this.platform.injector);
|
808
|
this._moduleRef = this._moduleFactory.create(ngZoneInjector);
|
809
|
// ApplicationInitStatus.runInitializers() is marked @internal to core. So casting to any
|
810
|
// before accessing it.
|
811
|
this._moduleRef.injector.get(_angular_core.ApplicationInitStatus).runInitializers();
|
812
|
this._instantiated = true;
|
813
|
};
|
814
|
TestBed.prototype._createCompilerAndModule = function () {
|
815
|
var _this = this;
|
816
|
var providers = this._providers.concat([{ provide: TestBed, useValue: this }]);
|
817
|
var declarations = this._declarations;
|
818
|
var imports = [this.ngModule, this._imports];
|
819
|
var schemas = this._schemas;
|
820
|
var DynamicTestModule = (function () {
|
821
|
function DynamicTestModule() {
|
822
|
}
|
823
|
return DynamicTestModule;
|
824
|
}());
|
825
|
DynamicTestModule.decorators = [
|
826
|
{ type: _angular_core.NgModule, args: [{ providers: providers, declarations: declarations, imports: imports, schemas: schemas },] },
|
827
|
];
|
828
|
/** @nocollapse */
|
829
|
DynamicTestModule.ctorParameters = function () { return []; };
|
830
|
var compilerFactory = this.platform.injector.get(TestingCompilerFactory);
|
831
|
this._compiler =
|
832
|
compilerFactory.createTestingCompiler(this._compilerOptions.concat([{ useDebug: true }]));
|
833
|
this._compiler.loadAotSummaries(this._aotSummaries);
|
834
|
this._moduleOverrides.forEach(function (entry) { return _this._compiler.overrideModule(entry[0], entry[1]); });
|
835
|
this._componentOverrides.forEach(function (entry) { return _this._compiler.overrideComponent(entry[0], entry[1]); });
|
836
|
this._directiveOverrides.forEach(function (entry) { return _this._compiler.overrideDirective(entry[0], entry[1]); });
|
837
|
this._pipeOverrides.forEach(function (entry) { return _this._compiler.overridePipe(entry[0], entry[1]); });
|
838
|
return DynamicTestModule;
|
839
|
};
|
840
|
TestBed.prototype._assertNotInstantiated = function (methodName, methodDescription) {
|
841
|
if (this._instantiated) {
|
842
|
throw new Error("Cannot " + methodDescription + " when the test module has already been instantiated. " +
|
843
|
("Make sure you are not using `inject` before `" + methodName + "`."));
|
844
|
}
|
845
|
};
|
846
|
TestBed.prototype.get = function (token, notFoundValue) {
|
847
|
if (notFoundValue === void 0) { notFoundValue = _angular_core.Injector.THROW_IF_NOT_FOUND; }
|
848
|
this._initIfNeeded();
|
849
|
if (token === TestBed) {
|
850
|
return this;
|
851
|
}
|
852
|
// Tests can inject things from the ng module and from the compiler,
|
853
|
// but the ng module can't inject things from the compiler and vice versa.
|
854
|
var result = this._moduleRef.injector.get(token, UNDEFINED);
|
855
|
return result === UNDEFINED ? this._compiler.injector.get(token, notFoundValue) : result;
|
856
|
};
|
857
|
TestBed.prototype.execute = function (tokens, fn, context) {
|
858
|
var _this = this;
|
859
|
this._initIfNeeded();
|
860
|
var params = tokens.map(function (t) { return _this.get(t); });
|
861
|
return fn.apply(context, params);
|
862
|
};
|
863
|
TestBed.prototype.overrideModule = function (ngModule, override) {
|
864
|
this._assertNotInstantiated('overrideModule', 'override module metadata');
|
865
|
this._moduleOverrides.push([ngModule, override]);
|
866
|
};
|
867
|
TestBed.prototype.overrideComponent = function (component, override) {
|
868
|
this._assertNotInstantiated('overrideComponent', 'override component metadata');
|
869
|
this._componentOverrides.push([component, override]);
|
870
|
};
|
871
|
TestBed.prototype.overrideDirective = function (directive, override) {
|
872
|
this._assertNotInstantiated('overrideDirective', 'override directive metadata');
|
873
|
this._directiveOverrides.push([directive, override]);
|
874
|
};
|
875
|
TestBed.prototype.overridePipe = function (pipe, override) {
|
876
|
this._assertNotInstantiated('overridePipe', 'override pipe metadata');
|
877
|
this._pipeOverrides.push([pipe, override]);
|
878
|
};
|
879
|
TestBed.prototype.overrideProvider = function (token, provider) {
|
880
|
this.overrideProviderImpl(token, provider);
|
881
|
};
|
882
|
TestBed.prototype.deprecatedOverrideProvider = function (token, provider) {
|
883
|
this.overrideProviderImpl(token, provider, /* deprecated */ true);
|
884
|
};
|
885
|
TestBed.prototype.overrideProviderImpl = function (token, provider, deprecated) {
|
886
|
if (deprecated === void 0) { deprecated = false; }
|
887
|
var flags = 0;
|
888
|
var value;
|
889
|
if (provider.useFactory) {
|
890
|
flags |= 1024 /* TypeFactoryProvider */;
|
891
|
value = provider.useFactory;
|
892
|
}
|
893
|
else {
|
894
|
flags |= 256 /* TypeValueProvider */;
|
895
|
value = provider.useValue;
|
896
|
}
|
897
|
var deps = (provider.deps || []).map(function (dep) {
|
898
|
var depFlags = 0;
|
899
|
var depToken;
|
900
|
if (Array.isArray(dep)) {
|
901
|
dep.forEach(function (entry) {
|
902
|
if (entry instanceof _angular_core.Optional) {
|
903
|
depFlags |= 2 /* Optional */;
|
904
|
}
|
905
|
else if (entry instanceof _angular_core.SkipSelf) {
|
906
|
depFlags |= 1 /* SkipSelf */;
|
907
|
}
|
908
|
else {
|
909
|
depToken = entry;
|
910
|
}
|
911
|
});
|
912
|
}
|
913
|
else {
|
914
|
depToken = dep;
|
915
|
}
|
916
|
return [depFlags, depToken];
|
917
|
});
|
918
|
_angular_core.ɵoverrideProvider({ token: token, flags: flags, deps: deps, value: value, deprecatedBehavior: deprecated });
|
919
|
};
|
920
|
TestBed.prototype.createComponent = function (component) {
|
921
|
var _this = this;
|
922
|
this._initIfNeeded();
|
923
|
var componentFactory = this._compiler.getComponentFactory(component);
|
924
|
if (!componentFactory) {
|
925
|
throw new Error("Cannot create the component " + _angular_core.ɵstringify(component) + " as it was not imported into the testing module!");
|
926
|
}
|
927
|
var noNgZone = this.get(ComponentFixtureNoNgZone, false);
|
928
|
var autoDetect = this.get(ComponentFixtureAutoDetect, false);
|
929
|
var ngZone = noNgZone ? null : this.get(_angular_core.NgZone, null);
|
930
|
var testComponentRenderer = this.get(TestComponentRenderer);
|
931
|
var rootElId = "root" + _nextRootElementId++;
|
932
|
testComponentRenderer.insertRootElement(rootElId);
|
933
|
var initComponent = function () {
|
934
|
var componentRef = componentFactory.create(_angular_core.Injector.NULL, [], "#" + rootElId, _this._moduleRef);
|
935
|
return new ComponentFixture(componentRef, ngZone, autoDetect);
|
936
|
};
|
937
|
var fixture = !ngZone ? initComponent() : ngZone.run(initComponent);
|
938
|
this._activeFixtures.push(fixture);
|
939
|
return fixture;
|
940
|
};
|
941
|
return TestBed;
|
942
|
}());
|
943
|
var _testBed = null;
|
944
|
/**
|
945
|
* @experimental
|
946
|
*/
|
947
|
function getTestBed() {
|
948
|
return _testBed = _testBed || new TestBed();
|
949
|
}
|
950
|
/**
|
951
|
* Allows injecting dependencies in `beforeEach()` and `it()`.
|
952
|
*
|
953
|
* Example:
|
954
|
*
|
955
|
* ```
|
956
|
* beforeEach(inject([Dependency, AClass], (dep, object) => {
|
957
|
* // some code that uses `dep` and `object`
|
958
|
* // ...
|
959
|
* }));
|
960
|
*
|
961
|
* it('...', inject([AClass], (object) => {
|
962
|
* object.doSomething();
|
963
|
* expect(...);
|
964
|
* })
|
965
|
* ```
|
966
|
*
|
967
|
* Notes:
|
968
|
* - inject is currently a function because of some Traceur limitation the syntax should
|
969
|
* eventually
|
970
|
* becomes `it('...', @Inject (object: AClass, async: AsyncTestCompleter) => { ... });`
|
971
|
*
|
972
|
* @stable
|
973
|
*/
|
974
|
function inject(tokens, fn) {
|
975
|
var testBed = getTestBed();
|
976
|
if (tokens.indexOf(AsyncTestCompleter) >= 0) {
|
977
|
// Not using an arrow function to preserve context passed from call site
|
978
|
return function () {
|
979
|
var _this = this;
|
980
|
// Return an async test method that returns a Promise if AsyncTestCompleter is one of
|
981
|
// the injected tokens.
|
982
|
return testBed.compileComponents().then(function () {
|
983
|
var completer = testBed.get(AsyncTestCompleter);
|
984
|
testBed.execute(tokens, fn, _this);
|
985
|
return completer.promise;
|
986
|
});
|
987
|
};
|
988
|
}
|
989
|
else {
|
990
|
// Not using an arrow function to preserve context passed from call site
|
991
|
return function () { return testBed.execute(tokens, fn, this); };
|
992
|
}
|
993
|
}
|
994
|
/**
|
995
|
* @experimental
|
996
|
*/
|
997
|
var InjectSetupWrapper = (function () {
|
998
|
function InjectSetupWrapper(_moduleDef) {
|
999
|
this._moduleDef = _moduleDef;
|
1000
|
}
|
1001
|
InjectSetupWrapper.prototype._addModule = function () {
|
1002
|
var moduleDef = this._moduleDef();
|
1003
|
if (moduleDef) {
|
1004
|
getTestBed().configureTestingModule(moduleDef);
|
1005
|
}
|
1006
|
};
|
1007
|
InjectSetupWrapper.prototype.inject = function (tokens, fn) {
|
1008
|
var self = this;
|
1009
|
// Not using an arrow function to preserve context passed from call site
|
1010
|
return function () {
|
1011
|
self._addModule();
|
1012
|
return inject(tokens, fn).call(this);
|
1013
|
};
|
1014
|
};
|
1015
|
return InjectSetupWrapper;
|
1016
|
}());
|
1017
|
function withModule(moduleDef, fn) {
|
1018
|
if (fn) {
|
1019
|
// Not using an arrow function to preserve context passed from call site
|
1020
|
return function () {
|
1021
|
var testBed = getTestBed();
|
1022
|
if (moduleDef) {
|
1023
|
testBed.configureTestingModule(moduleDef);
|
1024
|
}
|
1025
|
return fn.apply(this);
|
1026
|
};
|
1027
|
}
|
1028
|
return new InjectSetupWrapper(function () { return moduleDef; });
|
1029
|
}
|
1030
|
function getComponentType(error) {
|
1031
|
return error[_angular_core.ɵERROR_COMPONENT_TYPE];
|
1032
|
}
|
1033
|
/**
|
1034
|
* @license
|
1035
|
* Copyright Google Inc. All Rights Reserved.
|
1036
|
*
|
1037
|
* Use of this source code is governed by an MIT-style license that can be
|
1038
|
* found in the LICENSE file at https://angular.io/license
|
1039
|
*/
|
1040
|
/**
|
1041
|
* Public Test Library for unit testing Angular applications. Assumes that you are running
|
1042
|
* with Jasmine, Mocha, or a similar framework which exports a beforeEach function and
|
1043
|
* allows tests to be asynchronous by either returning a promise or using a 'done' parameter.
|
1044
|
*/
|
1045
|
var _global$1 = (typeof window === 'undefined' ? global : window);
|
1046
|
// Reset the test providers and the fake async zone before each test.
|
1047
|
if (_global$1.beforeEach) {
|
1048
|
_global$1.beforeEach(function () {
|
1049
|
TestBed.resetTestingModule();
|
1050
|
resetFakeAsyncZone();
|
1051
|
});
|
1052
|
}
|
1053
|
// TODO(juliemr): remove this, only used because we need to export something to have compilation
|
1054
|
// work.
|
1055
|
var __core_private_testing_placeholder__ = '';
|
1056
|
|
1057
|
exports.async = async;
|
1058
|
exports.ComponentFixture = ComponentFixture;
|
1059
|
exports.resetFakeAsyncZone = resetFakeAsyncZone;
|
1060
|
exports.fakeAsync = fakeAsync;
|
1061
|
exports.tick = tick;
|
1062
|
exports.flush = flush;
|
1063
|
exports.discardPeriodicTasks = discardPeriodicTasks;
|
1064
|
exports.flushMicrotasks = flushMicrotasks;
|
1065
|
exports.TestComponentRenderer = TestComponentRenderer;
|
1066
|
exports.ComponentFixtureAutoDetect = ComponentFixtureAutoDetect;
|
1067
|
exports.ComponentFixtureNoNgZone = ComponentFixtureNoNgZone;
|
1068
|
exports.TestBed = TestBed;
|
1069
|
exports.getTestBed = getTestBed;
|
1070
|
exports.inject = inject;
|
1071
|
exports.InjectSetupWrapper = InjectSetupWrapper;
|
1072
|
exports.withModule = withModule;
|
1073
|
exports.__core_private_testing_placeholder__ = __core_private_testing_placeholder__;
|
1074
|
exports.ɵTestingCompiler = TestingCompiler;
|
1075
|
exports.ɵTestingCompilerFactory = TestingCompilerFactory;
|
1076
|
|
1077
|
Object.defineProperty(exports, '__esModule', { value: true });
|
1078
|
|
1079
|
})));
|
1080
|
//# sourceMappingURL=core-testing.umd.js.map
|