You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can also use RxJS scheduler in `fakeAsync()` just like using `setTimeout()` or `setInterval()`, but you need to import `zone.js/dist/zone-patch-rxjs-fake-async` to patch RxJS scheduler.
466
+
You can also use RxJS scheduler in `fakeAsync()` just like using `setTimeout()` or `setInterval()`, but you need to import `zone.js/plugins/zone-patch-rxjs-fake-async` to patch RxJS scheduler.
467
467
<code-example
468
468
path="testing/src/app/demo/async-helper.spec.ts"
469
469
region="fake-async-test-rxjs">
@@ -583,7 +583,7 @@ Then you can assert that the quote element displays the expected text.
583
583
584
584
#### Async test with _waitForAsync()_
585
585
586
-
To use `waitForAsync()` functionality, you must import `zone.js/dist/zone-testing` in your test setup file.
586
+
To use `waitForAsync()` functionality, you must import `zone.js/testing` in your test setup file.
587
587
If you created your project with the Angular CLI, `zone-testing` is already imported in `src/test.ts`.
Copy file name to clipboardExpand all lines: aio/content/guide/upgrade-setup.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -308,7 +308,7 @@ So when IE is refreshed (manually or automatically by `ng serve`), sometimes the
308
308
309
309
## Appendix: Test using `fakeAsync()/waitForAsync()`
310
310
311
-
If you use the `fakeAsync()/waitForAsync()` helper function to run unit tests (for details, read the [Testing guide](guide/testing-components-scenarios#fake-async)), you need to import `zone.js/dist/zone-testing` in your test setup file.
311
+
If you use the `fakeAsync()/waitForAsync()` helper function to run unit tests (for details, read the [Testing guide](guide/testing-components-scenarios#fake-async)), you need to import `zone.js/testing` in your test setup file.
312
312
313
313
<divclass="alert is-important">
314
314
If you create project with `Angular/CLI`, it is already imported in `src/test.ts`.
@@ -317,12 +317,12 @@ If you create project with `Angular/CLI`, it is already imported in `src/test.ts
317
317
And in the earlier versions of `Angular`, the following files were imported or added in your html file:
318
318
319
319
```
320
-
import 'zone.js/dist/long-stack-trace-zone';
321
-
import 'zone.js/dist/proxy';
322
-
import 'zone.js/dist/sync-test';
323
-
import 'zone.js/dist/jasmine-patch';
324
-
import 'zone.js/dist/async-test';
325
-
import 'zone.js/dist/fake-async-test';
320
+
import 'zone.js/plugins/long-stack-trace-zone';
321
+
import 'zone.js/plugins/proxy';
322
+
import 'zone.js/plugins/sync-test';
323
+
import 'zone.js/plugins/jasmine-patch';
324
+
import 'zone.js/plugins/async-test';
325
+
import 'zone.js/plugins/fake-async-test';
326
326
```
327
327
328
328
You can still load those files separately, but the order is important, you must import `proxy` before `sync-test`, `async-test`, `fake-async-test` and `jasmine-patch`. And you also need to import `sync-test` before `jasmine-patch`, so it is recommended to just import `zone-testing` instead of loading those separated files.
0 commit comments