slushjs / slush-angular

A slush generator for AngularJS using the Google Angular App Structure Recommendations
129 stars 32 forks source link

karma tests - nomod #7

Closed bmatzner closed 10 years ago

bmatzner commented 10 years ago

Hello,

I can't figure out how to make karma test run with the given todo example on a freshly poured slush project named "test".

In karma.conf.js I added

    files: [
      'bower_components/angular/angular.js',
      'bower_components/angular-route/angular-route.js',
      'bower_components/angular-mocks/angular-mocks.js',
      'src/**/*.js'
    ],

Karma reports the following error:

Error: [$injector:nomod] Module 'test.todo' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
    http://errors.angularjs.org/1.2.16/$injector/nomod?p0=test.todo
    at […]//test/bower_components/angular/angular.js:1613

Thanks for pointers...

joakimbeng commented 10 years ago

There is no need to edit the karma.conf.js manually, the gulp-inject plugin handles that.

So you should be able to just run:

gulp test

And it should work.. Does it?

bmatzner commented 10 years ago

Hi Joakim, thanks, 'gulp test' does work, but for CI purposes, I'd like to be able to run karma directly, and the entire gulp system does a bit too much magic to figure out what would be necessary to pass to karma in a potentially growing app... Please feel free to close this issue, if that is beyond the scope of your project.

joakimbeng commented 10 years ago

@bmatzner I've now added the gulp task karma-conf, so by running gulp karma-conf then your CI-environment should be able to run karma directly without gulp.

bmatzner commented 10 years ago

Terrific! Thank you!