I have a 1.5 app that I'm converting to use webpack.

The karma+mocha unit tests worked just fine pre-webpack. These tests are 
pretty much copy-n-pasted from the guide for unit testing doc section 
"Simple HTML Element Directive".

(i.e. beforeEach injects $rootScope and $compile, an element is compiled, a 
$digest cycle is run, etc.)


But after plugging in karma-webpack those tests fail because the component 
controller function is no longer being called. The app runs normally, so it 
must be something wrong in the karma configuration.

In trying to diagnose the problem I built a pared-down karma-webpack app. 
It tests just fine, but I noticed an interesting difference: in the 
pared-down app the controller function is called during $compile, but in 
the real app (pre-webpack) it is called during $digest. My intuition keeps 
saying that my problem is related, but I can't google up any similar posts.

Any ideas? Anyone know how angular decides whether/when to initialize the 
controller for a directive/component? And how could karma-webpack be 
interfering with that logic?
Thanks!

P.S. Just edited all my dependency versions to '*' and ran `npm outdated` - 
I'm completely current.

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to