ocombe / ocLazyLoad

Lazy load modules & components in AngularJS
https://oclazyload.readme.io
MIT License
2.63k stars 510 forks source link

ocLazyLoad not allowing to execute jasmine test case #402

Open prasad-schoolerp opened 7 years ago

prasad-schoolerp commented 7 years ago

I recently added ocLazyLoad module in my app.

I am executing jasmine unit test case for home.controller.js.

In home.route.js I have following code

app.config(['$stateProvider', 'homeConfig', 'stateHelperServiceProvider', function config($stateProvider, appConfig, stateHelperService) { 'use strict';

    $stateProvider.state(appConfig.states.base, {
        url: appConfig.rootUrl,
        data: stateHelperService.createStateData(appConfig),
        views: {
            'main': {
                controller: 'homeController',
                templateUrl: 'apps/home/home.tpl.html',
                resolve: {
                    controller: ['$ocLazyLoad', function ($ocLazyLoad) {
                        //Projects should be loaded first before loading dashboard.
                        return $ocLazyLoad.load(["apps/assets/projects.bundle.js", "apps/assets/home.bundle.js"]);
                    }]
                }
            }
        }
    });
}]);

From above code the resolve section breaking the homeController unit test cases. If i comment the resolve section then all test cases are working fine.

Could you please provide your pointers for the same.