简体   繁体   中英

unit test stops at rxjs skipwhile

of({loadstatus: Loaded})
    .skipWhile(user => user.loadStatus !== Loaded)
    .take(1)
    .subscribe(user => do some stuff)

Why would a unit test not run the skipWhile? IE I set a breakpoint on the take(1) and I never reach it. The code does the thing I expect but I'm having a hard time trying to deal with what the skipWhile is doing during unit tests.

This behavior stopped when I added

import 'rxjs/add/operator/skipWhile';

to the imports of the component being tested.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM