mercredi 24 octobre 2018

jasmine doesn’t continue executing the code in subscribe callback once unsubscribe is invoked

I've used these stackblitz:

https://stackblitz.com/edit/dialog-example

https://stackblitz.com/edit/jasmine-testing

and merge in this one:

https://stackblitz.com/edit/jasmine-testing-r6bpfh

The example can be executed as in dialog-example setting TEST variable to false in main.ts, and can be checked that the expected behaviour is fullfilled: the dialogIsOpen variable is false after closing the dialog.

While testing I've mocked the dialog, so the afterClose event is fired inmediatly, but then the code beyond the unsubscribe call is not being executed. This can be checked changing the unsubscribe call and put after the dialogIsOpen = false; line.

Is this a bug? Should I not to unsubscribe from the event?

Aucun commentaire:

Enregistrer un commentaire