0

How to test (using Jasmine) Angular code encapsulated inside $(function(){...}) without breaking/halting in any way already working angular app? I have such a situation, when each module is defined like this:

$(function(){
  angular.module('templates', ['commons']) 
  ...
})

And I want to test it.

Nikita Vlasenko
  • 4,004
  • 7
  • 47
  • 87
  • They are both mine. I do not think it is a duplicate because I want all of my blocks `$(function(){...})` to remain and test in such a state if it is possible. I have found though a better solution: just to remove all of the `$(function(){...})`, then reorder my javascript imports, and only then test it, but still, is it actually possible to test WITH all of the `$(function(){...})` or it is not? Just curiosity. – Nikita Vlasenko Nov 03 '15 at 02:04
  • Have you tried also wrapping your test code in a document ready block? – m59 Nov 03 '15 at 02:17
  • Yep, tried it and the tests themselves stop being invoked, the `it` part. – Nikita Vlasenko Nov 03 '15 at 15:43

0 Answers0