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
### ▶ For _time based_ rxjs code (timeouts / intervals / animations) - use `fakeTime`
148
+
149
+
`fakeTime` is a utility function that wraps the test callback.
150
+
151
+
It does the following things:
152
+
153
+
1. Changes the `AsyncScheduler` delegate to use `VirtualTimeScheduler` (which gives you the ability to use "virtual time" instead of having long tests.
154
+
2. Passes a `flush` function you can call to `flush()` when you want to virtually pass time forward.
155
+
3. Works well with `done` if you pass it as the second parameter (instead of the first)
### ▶ For _ajax_ calls (http) - they shouldn't be tested in a unit / micro test... 😜
195
+
196
+
Yeah. Test those in an integration test
197
+
198
+
## Wanna learn more?
199
+
200
+
In my [class testing In action course](http://testangular.com/?utm_source=github&utm_medium=link&utm_campaign=observer-spy) I go over all the differences and show you how to use this library to test stuff like `switchMap`, `interval` etc...
0 commit comments