10

From the quickstart sb-admin-angular, I am trying to run the tests, but I get the error unable to init ocLazyLoad. (This is a Windows7 machine.)

The command I use to run the tests is:

$ grunt test --force

I understand from this thread that I must make sure that the path to the ocLazyLoad script is added in karma.conf.js.

files: [
  'bower_components/angular/angular.js',
  'bower_components/angular-mocks/angular-mocks.js',
  ...
  'bower_components/oclazyload/dist/ocLazyLoad.min.js',
  'app/scripts/**/*.js',
  'test/mock/**/*.js',
  'test/spec/**/*.js'
],

I have also tried using Bower to reinstall ocLacyLoad, as suggested in the aforementioned thread. I was given a choice of versions and selected the first option:

Unable to find a suitable version for oclazyload, please choose one:
    1) oclazyload#~0.5.2 which resolved to 0.5.2 and is required by sb-admin
    2) oclazyload#^1.0.9 which resolved to 1.0.9

What step am I missing or corrupting here, please?

Community
  • 1
  • 1
Don Subert
  • 2,636
  • 4
  • 27
  • 37

2 Answers2

5

I would update oclazyload in bower.json file to version 0.6.0 or higher. Some 0.5.x version introduced this bug and it is solved at 0.6.0 version on.

Current value on bower.json value of the example was 0.5.2 which you used, too.

References:

[1] https://github.com/ocombe/ocLazyLoad/issues/122 (issue in GitHub)

mico
  • 12,730
  • 12
  • 59
  • 99
  • I tried updating to 0.6.0. There was no change in output – Don Subert Mar 31 '16 at 00:54
  • 1
    did you use `bower uninstall` for the old package? So, that the correct version really comes in use. – mico Mar 31 '16 at 05:44
  • No. I did not take that step. I can't attempt it right now. If the bounty expires before I can try again, and it does work, I will figure out how to get you your points. – Don Subert Mar 31 '16 at 06:15
  • There comes an award period after the bounty expires, another 24h to react. – mico Mar 31 '16 at 06:16
  • Cool, I can definitely find time to test before that time – Don Subert Mar 31 '16 at 06:19
  • 1
    Actually, if you can get back to the selection phase, do select !2 instead of 1 and you are ok. You are facing a version conflict and !2 forces the newest to be used always. Look: http://stackoverflow.com/questions/25915729/unable-to-find-a-suitable-version-for-angular-bower-install and remember the ! before 2 so it greates that resolution! – mico Mar 31 '16 at 19:23
3

It looks like this is what you are experiencing:

This should be fixed in ocLazyLoad 0.6.0.

alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195