运行test.sh
时出现此错误。 (我想我从aungular-seed项目得到了test.sh)
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
为什么?
答案 0 :(得分:7)
您需要在karma.conf.js文件中包含angular.js:'public/lib/angular*/angular.js'
这解决了我的问题,但也许有更好的方法。另请参阅karma.conf.js file from the angular-seed project。
// 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'
],