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

Fixed Provider.$inject support #11

Closed mitchogaard closed 8 years ago

mitchogaard commented 8 years ago

The block that ran sanitizeProvider(...) was getting called twice: once before mock object construction and once after the construction of the provider. I found that it was interfering with the logic that populates the mocks into the mocks object. I've removed the offending code (the block preceding mock object construction), changed some of the logic around the looping of currProviderDeps, and fixed some lines that were using spaces instead of tabs for indenting.

tennisgent commented 8 years ago

@mitchogaard, It looks like everything is working as expected. Here's a plunker that shows that all of my test specs are passing: http://plnkr.co/edit/6y40R9kUQ2rzdV5hkCbT?p=preview

Thanks.