mardi 24 mars 2015

Angular, Karma testing function - matching key in object

I believe I have the syntax wrong in this instance that I am testing, I am calling a function that returns and object, and I want to check if the object I pushed in is inside. So I'm checking like so :



expect(URLprovider.modules()).to.equal("module1");


And it's returning



AssertionError: expected { Object (module1) } to equal 'module1'


So the expected return is correct, how do I format the right side correctly ( .to.equal("module1"); ), or ask for just the key of module 1 correctly so this comes back as a passing test? Thanks!


Aucun commentaire:

Enregistrer un commentaire