I try to write some unit tests with Karma and get the following error:
PhantomJS 1.9.8 (Mac OS X) ERROR Error: [$ injector: nomod] Module "portfolioMockupApp.services" is not available! You either mistakenly wrote the name of the module, or forgot to load it. If registering a module ensures that you specify the dependencies as the second argument. http://errors.angularjs.org/1.3.3/ $ injector / nomod? p0 = portfolioMockupApp.services at / Users / danielbogart / Documents / coding / work / portfolio-mockup / bower_components / angular / angular.js: 1749
In addition, I have two separate files in the portfolioMockupApp.services module, both stored in the scripts / services directory.
Karma.conf file section:
files: [ 'bower_components/angular/angular.js', 'bower_components/angular-mocks/angular-mocks.js', 'bower_components/angular-animate/angular-animate.js', 'bower_components/angular-cookies/angular-cookies.js', 'bower_components/angular-resource/angular-resource.js', 'bower_components/angular-sanitize/angular-sanitize.js', 'bower_components/angular-touch/angular-touch.js', 'test/mock/**/*.js', 'test/spec/**/*.js', 'app/scripts/services/*.js', 'app/scripts/directives/*.js', 'app/scripts/controllers/*.js', 'app/scripts/app.js', 'node_modules/angular/angular.js', 'node_modules/angular-mocks/angular-mocks.js', './src/**/*.js', './test/**/*.js' ],
Portfolio.js spec (first and only test currently):
'use strict'; describe('Controller: PortfolioCtrl', function () {
javascript angularjs unit-testing phantomjs karma-runner
Daniel Bogart
source share