Edmondo
Edmondo

Reputation: 20080

Yeoman: use Bower-defined dependency in controllers and test

I have added a dependency to the bower.json and I would like to use it in a angularJs service or controller.

When I use the library inside a web page, everything works correctly because the dependencies are loaded first. This is not the case when I am running unit tests, where dependencies results in an undefined object and my test fails.

How can I import bower-defined dependencies in an angularJs controller for testing purpose?

Upvotes: 0

Views: 119

Answers (1)

merejy
merejy

Reputation: 404

I guess that you need to execute:

bower install yourdep --save

Otherwise it won't be saved in the bower.json.

Upvotes: 1

Related Questions