mardi 2 juin 2015

ReferenceError: module is not defined (angular js unit testing with Jasmine)

I found a lot of questions about this, but the answers didn't work for me.

I have a small controller in angular js. It works fine, and I wanted to start testing.

I downloaded Jasmine standalone from here. I put my controller in the "src" folder, and another js file in "specs", following the instructions provided here. Then I edited the SpecRunner.html including my files. It didn't work.

After looking for solutions for the "module is not defined" error, I included the angular-mocs.js reference in the html and in the karma.conf.js file, making sure that is was before the tests. It still doesn't work.

Anyone knows what can be wrong?

Aucun commentaire:

Enregistrer un commentaire