@angular/core 12.0.0-rc.2 → 12.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/core-testing.umd.js +42 -25
- package/bundles/core-testing.umd.js.map +1 -1
- package/bundles/core.umd.js +47 -23
- package/bundles/core.umd.js.map +1 -1
- package/core.d.ts +26 -6
- package/core.metadata.json +1 -1
- package/esm2015/src/core_private_export.js +2 -1
- package/esm2015/src/di/injector.js +1 -1
- package/esm2015/src/render3/error_code.js +1 -1
- package/esm2015/src/render3/instructions/listener.js +6 -3
- package/esm2015/src/render3/jit/module.js +5 -5
- package/esm2015/src/render3/node_manipulation.js +18 -3
- package/esm2015/src/render3/util/discovery_utils.js +18 -12
- package/esm2015/src/render3/view_ref.js +3 -3
- package/esm2015/src/version.js +1 -1
- package/esm2015/testing/src/fake_async.js +42 -25
- package/fesm2015/core.js +47 -24
- package/fesm2015/core.js.map +1 -1
- package/fesm2015/testing.js +42 -25
- package/fesm2015/testing.js.map +1 -1
- package/package.json +2 -5
- package/schematics/migrations/deep-shadow-piercing-selector/index.d.ts +10 -0
- package/schematics/migrations/deep-shadow-piercing-selector/index.js +49 -0
- package/schematics/migrations.json +5 -0
- package/src/r3_symbols.d.ts +1 -1
- package/testing/testing.d.ts +42 -25
- package/testing.d.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v12.0.
|
|
2
|
+
* @license Angular v12.0.2
|
|
3
3
|
* (c) 2010-2021 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -280,21 +280,25 @@
|
|
|
280
280
|
throw new Error(fakeAsyncTestModuleNotLoadedErrorMessage);
|
|
281
281
|
}
|
|
282
282
|
/**
|
|
283
|
-
* Wraps a function to be executed in the fakeAsync zone:
|
|
284
|
-
* -
|
|
285
|
-
* -
|
|
283
|
+
* Wraps a function to be executed in the `fakeAsync` zone:
|
|
284
|
+
* - Microtasks are manually executed by calling `flushMicrotasks()`.
|
|
285
|
+
* - Timers are synchronous; `tick()` simulates the asynchronous passage of time.
|
|
286
286
|
*
|
|
287
|
-
* If there are any pending timers at the end of the function, an exception
|
|
287
|
+
* If there are any pending timers at the end of the function, an exception is thrown.
|
|
288
288
|
*
|
|
289
|
-
* Can be used to wrap inject() calls.
|
|
289
|
+
* Can be used to wrap `inject()` calls.
|
|
290
|
+
*
|
|
291
|
+
* @param fn The function that you want to wrap in the `fakeAysnc` zone.
|
|
290
292
|
*
|
|
291
293
|
* @usageNotes
|
|
292
294
|
* ### Example
|
|
293
295
|
*
|
|
294
296
|
* {@example core/testing/ts/fake_async.ts region='basic'}
|
|
295
297
|
*
|
|
296
|
-
*
|
|
297
|
-
* @returns The function wrapped to be executed in the fakeAsync zone
|
|
298
|
+
*
|
|
299
|
+
* @returns The function wrapped to be executed in the `fakeAsync` zone.
|
|
300
|
+
* Any arguments passed when calling this returned function will be passed through to the `fn`
|
|
301
|
+
* function in the parameters when it is called.
|
|
298
302
|
*
|
|
299
303
|
* @publicApi
|
|
300
304
|
*/
|
|
@@ -305,23 +309,36 @@
|
|
|
305
309
|
throw new Error(fakeAsyncTestModuleNotLoadedErrorMessage);
|
|
306
310
|
}
|
|
307
311
|
/**
|
|
308
|
-
* Simulates the asynchronous passage of time for the timers in the fakeAsync zone.
|
|
312
|
+
* Simulates the asynchronous passage of time for the timers in the `fakeAsync` zone.
|
|
309
313
|
*
|
|
310
314
|
* The microtasks queue is drained at the very start of this function and after any timer callback
|
|
311
315
|
* has been executed.
|
|
312
316
|
*
|
|
317
|
+
* @param millis The number of milliseconds to advance the virtual timer.
|
|
318
|
+
* @param tickOptions The options to pass to the `tick()` function.
|
|
319
|
+
*
|
|
313
320
|
* @usageNotes
|
|
321
|
+
*
|
|
322
|
+
* The `tick()` option is a flag called `processNewMacroTasksSynchronously`,
|
|
323
|
+
* which determines whether or not to invoke new macroTasks.
|
|
324
|
+
*
|
|
325
|
+
* If you provide a `tickOptions` object, but do not specify a
|
|
326
|
+
* `processNewMacroTasksSynchronously` property (`tick(100, {})`),
|
|
327
|
+
* then `processNewMacroTasksSynchronously` defaults to true.
|
|
328
|
+
*
|
|
329
|
+
* If you omit the `tickOptions` parameter (`tick(100))`), then
|
|
330
|
+
* `tickOptions` defaults to `{processNewMacroTasksSynchronously: true}`.
|
|
331
|
+
*
|
|
314
332
|
* ### Example
|
|
315
333
|
*
|
|
316
334
|
* {@example core/testing/ts/fake_async.ts region='basic'}
|
|
317
335
|
*
|
|
318
|
-
*
|
|
319
|
-
*
|
|
320
|
-
* processNewMacroTasksSynchronously
|
|
321
|
-
*
|
|
322
|
-
*
|
|
323
|
-
* For example,
|
|
336
|
+
* The following example includes a nested timeout (new macroTask), and
|
|
337
|
+
* the `tickOptions` parameter is allowed to default. In this case,
|
|
338
|
+
* `processNewMacroTasksSynchronously` defaults to true, and the nested
|
|
339
|
+
* function is executed on each tick.
|
|
324
340
|
*
|
|
341
|
+
* ```
|
|
325
342
|
* it ('test with nested setTimeout', fakeAsync(() => {
|
|
326
343
|
* let nestedTimeoutInvoked = false;
|
|
327
344
|
* function funcWithNestedTimeout() {
|
|
@@ -333,10 +350,12 @@
|
|
|
333
350
|
* tick();
|
|
334
351
|
* expect(nestedTimeoutInvoked).toBe(true);
|
|
335
352
|
* }));
|
|
353
|
+
* ```
|
|
336
354
|
*
|
|
337
|
-
*
|
|
338
|
-
*
|
|
355
|
+
* In the following case, `processNewMacroTasksSynchronously` is explicitly
|
|
356
|
+
* set to false, so the nested timeout function is not invoked.
|
|
339
357
|
*
|
|
358
|
+
* ```
|
|
340
359
|
* it ('test with nested setTimeout', fakeAsync(() => {
|
|
341
360
|
* let nestedTimeoutInvoked = false;
|
|
342
361
|
* function funcWithNestedTimeout() {
|
|
@@ -348,9 +367,7 @@
|
|
|
348
367
|
* tick(0, {processNewMacroTasksSynchronously: false});
|
|
349
368
|
* expect(nestedTimeoutInvoked).toBe(false);
|
|
350
369
|
* }));
|
|
351
|
-
*
|
|
352
|
-
* if we pass the tickOptions with processNewMacroTasksSynchronously to be false, the nested timeout
|
|
353
|
-
* will not be invoked.
|
|
370
|
+
* ```
|
|
354
371
|
*
|
|
355
372
|
*
|
|
356
373
|
* @publicApi
|
|
@@ -366,12 +383,12 @@
|
|
|
366
383
|
throw new Error(fakeAsyncTestModuleNotLoadedErrorMessage);
|
|
367
384
|
}
|
|
368
385
|
/**
|
|
369
|
-
* Simulates the asynchronous passage of time for the timers in the fakeAsync zone by
|
|
370
|
-
* draining the macrotask queue until it is empty.
|
|
371
|
-
* of time that would have been elapsed.
|
|
386
|
+
* Simulates the asynchronous passage of time for the timers in the `fakeAsync` zone by
|
|
387
|
+
* draining the macrotask queue until it is empty.
|
|
372
388
|
*
|
|
373
|
-
* @param maxTurns
|
|
374
|
-
*
|
|
389
|
+
* @param maxTurns The maximum number of times the scheduler attempts to clear its queue before
|
|
390
|
+
* throwing an error.
|
|
391
|
+
* @returns The simulated time elapsed, in milliseconds.
|
|
375
392
|
*
|
|
376
393
|
* @publicApi
|
|
377
394
|
*/
|