Observable.fromPromise empty during unit testing

前端 未结 1 1359
星月不相逢
星月不相逢 2021-01-13 22:48

loadAdList$ is an Observable that taps into the actions$ stream:

loadAdList$: Observable = this.actions$
    .ofType&         


        
相关标签:
1条回答
  • 2021-01-13 23:25

    It is bit unfortunate but there wasn't great way to make promise resolves synchronously under context of TestScheduler in Rx v5. For those reason, if Observable source started off from promise it won't work with marble testings and you have to create assertion differently by subscribing.

    Check https://github.com/ReactiveX/rxjs/issues/701 / https://github.com/ReactiveX/rxjs/pull/745 if you'd like to have detail why it wasn't successful.

    0 讨论(0)
提交回复
热议问题