{"action":"created","issue":{"url":"https://api.github.com/repos/ocombe/ocLazyLoad/issues/162","labels_url":"https://api.github.com/repos/ocombe/ocLazyLoad/issues/162/labels{/name}","comments_url":"https://api.github.com/repos/ocombe/ocLazyLoad/issues/162/comments","events_url":"https://api.github.com/repos/ocombe/ocLazyLoad/issues/162/events","html_url":"https://github.com/ocombe/ocLazyLoad/issues/162","id":67456519,"number":162,"title":"Usage in unit tests","user":{"login":"scriby","id":815188,"avatar_url":"https://avatars.githubusercontent.com/u/815188?v=3","gravatar_id":"","url":"https://api.github.com/users/scriby","html_url":"https://github.com/scriby","followers_url":"https://api.github.com/users/scriby/followers","following_url":"https://api.github.com/users/scriby/following{/other_user}","gists_url":"https://api.github.com/users/scriby/gists{/gist_id}","starred_url":"https://api.github.com/users/scriby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scriby/subscriptions","organizations_url":"https://api.github.com/users/scriby/orgs","repos_url":"https://api.github.com/users/scriby/repos","events_url":"https://api.github.com/users/scriby/events{/privacy}","received_events_url":"https://api.github.com/users/scriby/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ocombe/ocLazyLoad/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-04-09T21:37:22Z","updated_at":"2015-04-09T23:13:59Z","closed_at":null,"body":"I ran into a snag in an application I'm working on which uses oclazyload during some unit tests.\r\n\r\nThe crux of the problem is this line:\r\n\r\n```\r\nreturn instanceInjector ? instanceInjector : instanceInjector = $rootElement.data(\"$injector\") || angular.injector();\r\n```\r\n\r\nThe problem is that bootstrap doesn't occur during the tests, so there's no injector on the root element. It always ends up with a fresh injector, so any time it tries to run a config or run block it can't find the dependencies.\r\n\r\nI am wondering if you had any thoughts about this scenario and the best way to handle it. I'm going to take a look at the test and if there's another way to do it as well."},"comment":{"url":"https://api.github.com/repos/ocombe/ocLazyLoad/issues/comments/91378618","html_url":"https://github.com/ocombe/ocLazyLoad/issues/162#issuecomment-91378618","issue_url":"https://api.github.com/repos/ocombe/ocLazyLoad/issues/162","id":91378618,"user":{"login":"scriby","id":815188,"avatar_url":"https://avatars.githubusercontent.com/u/815188?v=3","gravatar_id":"","url":"https://api.github.com/users/scriby","html_url":"https://github.com/scriby","followers_url":"https://api.github.com/users/scriby/followers","following_url":"https://api.github.com/users/scriby/following{/other_user}","gists_url":"https://api.github.com/users/scriby/gists{/gist_id}","starred_url":"https://api.github.com/users/scriby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scriby/subscriptions","organizations_url":"https://api.github.com/users/scriby/orgs","repos_url":"https://api.github.com/users/scriby/repos","events_url":"https://api.github.com/users/scriby/events{/privacy}","received_events_url":"https://api.github.com/users/scriby/received_events","type":"User","site_admin":false},"created_at":"2015-04-09T23:13:59Z","updated_at":"2015-04-09T23:13:59Z","body":"@lookfirst we are using angular mocks in a similar way to get the injector. The problem is more the interaction with oclazyload, since it doesn't use the same injector instance as the unit tests."}}