jeudi 3 décembre 2015

How to check if object is promise in Angular unit tests?

I want to have an assert that checks if the returned object from calling a method is a promise.

Is it enough to check if it exists and has a then method?
Or is there a better way of doing this since having a then method doesn't guarantee the object is a $q deferred promise?

Thanks.

Aucun commentaire:

Enregistrer un commentaire