Jess
Jess

Reputation: 25039

Karma error Cannot call method 'module' of undefined

I am getting this error when running test.sh. (I think I got test.sh from the aungular-seed project)

INFO [Chrome 26.0.1410 (Linux)]: Connected on socket gB-olqxn3xDa6fV2ENBw
Chrome 26.0.1410 (Linux) ERROR
    Uncaught TypeError: Cannot call method 'module' of undefined
    at /home/me/git/blah/blah/public/lib/angular-1.0.7/angular-cookies.js:15

Why?

Upvotes: 2

Views: 5084

Answers (1)

Jess
Jess

Reputation: 25039

You need to include angular.js in your karma.conf.js file: 'public/lib/angular*/angular.js'

This solved the problem for me, but maybe there is a better way also. See also the karma.conf.js file from the angular-seed project.

config/karma.conf.js:

// list of files / patterns to load in the browser
files: [
  'public/lib/angular*/angular.js',
  'public/lib/**/*.js',
  'public/js/**/*.js',
  'routes/**/*.js',
  'server/**/*.js',
  'test/unit/**/*Spec.js'
],

Upvotes: 7

Related Questions