tennisgent / quickmock

quickmock is an simple service for automatically injecting mocks into your AngularJS unit tests using Jasmine or Mocha
http://tennisgent.github.io/quickmock
34 stars 14 forks source link

Fixing mockProvider, adding support for ng-annotate #5

Closed evertonrobertoauler closed 9 years ago

evertonrobertoauler commented 9 years ago

Hello, I'm starting to use this awesome library, but I had this issue with the mockProvider, because I declare my services like below, and use webpack ng-annotate-loader, who creates Api.$inject where are the currProviderDeps.

/* @ngInject / function Api($http, $state, $ionicLoading, $ionicHistory, $ionicPopup) {}

tennisgent commented 9 years ago

Good catch! I hadn't thought of the case where the injected function already has the .$inject attribute. I'm glad you brought it to my attention. I appreciate your pull request and I'll merge it for now, but I think I have a better spot to put that fix. I'll make that change as soon as I have a few spare seconds and get it fixed more permanently. Thanks for the help.