vendredi 26 octobre 2018

Set global properties in karma

How to set some global variable to windows object. In my case we set some model to windows object through index.html. And in our components we use that model directly. But while running unit tests it doesn't found that object and test fails. I tried setting the model in spec file as: window.appConfig={}; But its throwing the error.

Aucun commentaire:

Enregistrer un commentaire