-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Karma tests not running #251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I am having the same problem. Even after fixing the couple issues in the latest update with the incorrect file path and syntax error I am getting the same issue. |
I think i may have found the solution. if I include the following in the karma config file the tests are running correctly. files: [
'../app/bower_components/angular/angular.js',
'../app/bower_components/angular-mocks/angular-mocks.js',
'../app/bower_components/angular-resource/angular-resource.js',
'../app/bower_components/angular-cookies/angular-cookies.js',
'../app/bower_components/angular-sanitize/angular-sanitize.js',
'../app/bower_components/angular-route/angular-route.js',
'../app/scripts/*.js',
'../app/scripts/**/*.js',
'client/spec/**/*.js'
] |
I can confirm @DannyBlueDesign's solution. I copy-pasted the paths to the files array in the karma config and the test for MainCtrl runs (and fails for me, because I altered MainCtrl without adapting it's test...). I did not test whether or not all paths are required and can not tell if this is the right way to solve the problem or not, since I'm new to karma (and test's in web development in general). But for now it does the trick for me and I can start fixing my test, so thanks @DannyBlueDesign! |
TEST ALL THE THINGS!!!!! |
It's odd that snippet wasn't already there, my project built with an older version of the had it. @melo0187 I'm guessing you're using v.1.4.3? |
@JaKXz yes I am using v.1.4.3 of generator-angular-fullstack, installed globally with npm. |
That is how I found something to fix it. I looked through an older build I had done to compare. |
I'm having the same problem, and unless I'm missing something, the above solution by DannyBlueDesign doesn't fix it. Can someone point in the right direction? It happens on both Fedora and Windows. Even the verbose output doesn't make sense, because the karma.conf.js file lists a number of files, and they all exist in the project directories. Here's the verbose output in Windows. The punchline is that everything seems to go fine, but it says File: [no files] on the karma init, followed by "Executed 0 of 0 ERROR":
Following is my karma.conf.js in the project root: // Karma configuration
// http://karma-runner.github.io/0.10/config/configuration-file.html
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '',
// testing framework to use (jasmine/mocha/qunit/...)
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: [
'client/bower_components/jquery/dist/jquery.js',
'client/bower_components/angular/angular.js',
'client/bower_components/angular-mocks/angular-mocks.js',
'client/bower_components/angular-resource/angular-resource.js',
'client/bower_components/angular-cookies/angular-cookies.js',
'client/bower_components/angular-sanitize/angular-sanitize.js',
'client/bower_components/angular-bootstrap/ui-bootstrap-tpls.js',
'client/bower_components/angular-ui-router/release/angular-ui-router.js',
'client/bower_components/lodash/dist/lodash.compat.js',
'client/app/app.coffee',
'client/app/**/*.coffee',
'client/components/**/*.coffee',
'client/app/**/*.html',
'client/components/**/*.html'
],
preprocessors: {
'**/*.jade': 'ng-jade2js',
'**/*.html': 'html2js',
'**/*.coffee': 'coffee',
},
ngHtml2JsPreprocessor: {
stripPrefix: 'client/'
},
ngJade2JsPreprocessor: {
stripPrefix: 'client/'
},
// list of files / patterns to exclude
exclude: [],
// web server port
port: 8080,
// level of logging
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,
// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
browsers: ['PhantomJS'],
// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: false
});
}; |
@brandon-arnold, excuse me for my ignorance(?) but I was wondering what version of the generator you were using? |
Thanks, Cody: I've just updated, and the version is 2.0.10, after having updated. -Brandon |
@brandon-arnold are you still having the issue after updating to the new version? |
@kingcody: Yep. any idea where I can find a more verbose debug output? |
In |
@kingcody: Thanks for the tip! I did it, but after having run grunt again, I'm unfortunately still baffled. Does anything jump out as noteworthy in the below output?
|
Honestly no, it would seem karma was not able to find(?) any test. Odd as theres no error. It did say that it served |
@kingcody: That led me to the fix! I apparently didn't have a test defined in main.controller.spec.js, and the karma section needs at least one test. Thanks much! |
@brandon-arnold thanks so much just had the same problem. |
Hi Guys, i have same issue, but my test file have a test unlike brandon-arnold, here is the output grunt test --verbose Reading "Gruntfile.js" Gruntfile...OK Registering Gruntfile tasks. Registering "grunt-autoprefixer" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-autoprefixer/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-autoprefixer/package.json...OK Loading "autoprefixer.js" tasks...OK + autoprefixer Registering "grunt-cdnify" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-cdnify/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-cdnify/package.json...OK Loading "cdnify.js" tasks...OK + cdnify Registering "grunt-concurrent" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-concurrent/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-concurrent/package.json...OK Loading "concurrent.js" tasks...OK + concurrent Registering "grunt-connect" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-connect/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-connect/package.json...OK Loading "connect.js" tasks...OK + connect Registering "grunt-contrib-clean" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-clean/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-clean/package.json...OK Loading "clean.js" tasks...OK + clean Registering "grunt-contrib-compass" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-compass/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-compass/package.json...OK Loading "compass.js" tasks...OK + compass Registering "grunt-contrib-concat" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-concat/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-concat/package.json...OK Loading "concat.js" tasks...OK + concat Registering "grunt-contrib-connect" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-connect/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-connect/package.json...OK Loading "connect.js" tasks...OK + connect Registering "grunt-contrib-copy" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-copy/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-copy/package.json...OK Loading "copy.js" tasks...OK + copy Registering "grunt-contrib-cssmin" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-cssmin/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-cssmin/package.json...OK Loading "cssmin.js" tasks...OK + cssmin Registering "grunt-contrib-htmlmin" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-htmlmin/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-htmlmin/package.json...OK Loading "htmlmin.js" tasks...OK + htmlmin Registering "grunt-contrib-imagemin" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-imagemin/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-imagemin/package.json...OK Loading "imagemin.js" tasks...OK + imagemin Registering "grunt-contrib-jshint" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-jshint/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-jshint/package.json...OK Loading "jshint.js" tasks...OK + jshint Registering "grunt-contrib-uglify" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-uglify/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-uglify/package.json...OK Loading "uglify.js" tasks...OK + uglify Registering "grunt-contrib-watch" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-watch/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-watch/package.json...OK Loading "watch.js" tasks...OK + watch Registering "grunt-filerev" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-filerev/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-filerev/package.json...OK Loading "filerev.js" tasks...OK + filerev Registering "grunt-google-cdn" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-google-cdn/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-google-cdn/package.json...OK Loading "cdnify.js" tasks...OK + cdnify Registering "grunt-karma" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-karma/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-karma/package.json...OK Loading "grunt-karma.js" tasks...OK + karma Registering "grunt-newer" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-newer/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-newer/package.json...OK Loading "newer.js" tasks...OK + any-newer, newer, newer-clean, newer-postrun Registering "grunt-ng-annotate" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-ng-annotate/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-ng-annotate/package.json...OK Loading "ng-annotate.js" tasks...OK + ngAnnotate Registering "grunt-svgmin" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-svgmin/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-svgmin/package.json...OK Loading "svgmin.js" tasks...OK + svgmin Registering "grunt-usemin" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-usemin/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-usemin/package.json...OK Loading "usemin.js" tasks...OK + usemin, useminPrepare Registering "grunt-wiredep" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-wiredep/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-wiredep/package.json...OK Loading "wiredep.js" tasks...OK + wiredep Initializing config...OK Loading "Gruntfile.js" tasks...OK + build, default, serve, server, test Running tasks: test Running "test" task Running "clean:server" (clean) task Verifying property clean.server exists in config...OK Files: .tmp -> server Options: force=false, no-write=false Options: force=false, no-write=false Cleaning .tmp...OK Running "concurrent:test" (concurrent) task Verifying property concurrent.test exists in config...OK Files: [no src] -> test Options: limit=4 Initializing Command-line options: --verbose Reading "Gruntfile.js" Gruntfile...OK Registering Gruntfile tasks. Registering "grunt-autoprefixer" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-autoprefixer/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-autoprefixer/package.json...OK Loading "autoprefixer.js" tasks...OK + autoprefixer Registering "grunt-cdnify" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-cdnify/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-cdnify/package.json...OK Loading "cdnify.js" tasks...OK + cdnify Registering "grunt-concurrent" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-concurrent/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-concurrent/package.json...OK Loading "concurrent.js" tasks...OK + concurrent Registering "grunt-connect" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-connect/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-connect/package.json...OK Loading "connect.js" tasks...OK + connect Registering "grunt-contrib-clean" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-clean/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-clean/package.json...OK Loading "clean.js" tasks...OK + clean Registering "grunt-contrib-compass" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-compass/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-compass/package.json...OK Loading "compass.js" tasks...OK + compass Registering "grunt-contrib-concat" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-concat/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-concat/package.json...OK Loading "concat.js" tasks...OK + concat Registering "grunt-contrib-connect" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-connect/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-connect/package.json...OK Loading "connect.js" tasks...OK + connect Registering "grunt-contrib-copy" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-copy/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-copy/package.json...OK Loading "copy.js" tasks...OK + copy Registering "grunt-contrib-cssmin" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-cssmin/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-cssmin/package.json...OK Loading "cssmin.js" tasks...OK + cssmin Registering "grunt-contrib-htmlmin" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-htmlmin/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-htmlmin/package.json...OK Loading "htmlmin.js" tasks...OK + htmlmin Registering "grunt-contrib-imagemin" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-imagemin/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-imagemin/package.json...OK Loading "imagemin.js" tasks...OK + imagemin Registering "grunt-contrib-jshint" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-jshint/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-jshint/package.json...OK Loading "jshint.js" tasks...OK + jshint Registering "grunt-contrib-uglify" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-uglify/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-uglify/package.json...OK Loading "uglify.js" tasks...OK + uglify Registering "grunt-contrib-watch" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-watch/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-contrib-watch/package.json...OK Loading "watch.js" tasks...OK + watch Registering "grunt-filerev" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-filerev/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-filerev/package.json...OK Loading "filerev.js" tasks...OK + filerev Registering "grunt-google-cdn" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-google-cdn/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-google-cdn/package.json...OK Loading "cdnify.js" tasks...OK + cdnify Registering "grunt-karma" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-karma/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-karma/package.json...OK Loading "grunt-karma.js" tasks...OK + karma Registering "grunt-newer" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-newer/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-newer/package.json...OK Loading "newer.js" tasks...OK + any-newer, newer, newer-clean, newer-postrun Registering "grunt-ng-annotate" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-ng-annotate/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-ng-annotate/package.json...OK Loading "ng-annotate.js" tasks...OK + ngAnnotate Registering "grunt-svgmin" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-svgmin/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-svgmin/package.json...OK Loading "svgmin.js" tasks...OK + svgmin Registering "grunt-usemin" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-usemin/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-usemin/package.json...OK Loading "usemin.js" tasks...OK + usemin, useminPrepare Registering "grunt-wiredep" local Npm module tasks. Reading /home/utkarsh/angular_dev/test/node_modules/grunt-wiredep/package.json...OK Parsing /home/utkarsh/angular_dev/test/node_modules/grunt-wiredep/package.json...OK Loading "wiredep.js" tasks...OK + wiredep Initializing config...OK Loading "Gruntfile.js" tasks...OK + build, default, serve, server, test Running tasks: compass Running "compass" task Running "compass:dist" (compass) task Verifying property compass.dist exists in config...OK File: [no files] Options: sassDir="app/styles", cssDir=".tmp/styles", generatedImagesDir="dist/images/generated", imagesDir="app/images", javascriptsDir="app/scripts", fontsDir="app/styles/fonts", importPath="./bower_components", httpImagesPath="/images", httpGeneratedImagesPath="/images/generated", httpFontsPath="/styles/fonts", relativeAssets=false, assetCacheBuster=false, raw="Sass::Script::Number.precision = 10\n" directory .tmp/styles write .tmp/styles/main.css (1.119s) Running "compass:server" (compass) task Verifying property compass.server exists in config...OK File: [no files] Options: sassDir="app/styles", cssDir=".tmp/styles", generatedImagesDir=".tmp/images/generated", imagesDir="app/images", javascriptsDir="app/scripts", fontsDir="app/styles/fonts", importPath="./bower_components", httpImagesPath="/images", httpGeneratedImagesPath="/images/generated", httpFontsPath="/styles/fonts", relativeAssets=false, assetCacheBuster=false, raw="Sass::Script::Number.precision = 10\n", debugInfo Done, without errors. Execution Time (2014-11-23 18:26:46 UTC) loading tasks 4ms 0% compass:dist 1.4s ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 77% compass:server 414ms ▇▇▇▇▇▇▇▇▇▇▇ 23% Total 1.8s Running "autoprefixer" task Running "autoprefixer:dist" (autoprefixer) task Verifying property autoprefixer.dist exists in config...OK Files: .tmp/styles/main.css -> .tmp/styles/main.css Options: cascade, diff=false, map=false, silent=false, remove, browsers=["last 1 version"] Reading .tmp/styles/main.css...OK Writing .tmp/styles/main.css...OK File .tmp/styles/main.css created. Running "connect:test" (connect) task Verifying property connect.test exists in config...OK File: [no files] Options: protocol="http", port=9001, hostname="localhost", base=".", directory=null, keepalive=false, debug=false, livereload=35729, open=false, useAvailablePort=false, onCreateServer=null, middleware=undefined Started connect web server on http://localhost:9001 Running "karma" task Running "karma:unit" (karma) task Verifying property karma.unit exists in config...OK File: [no files] Options: background=false DEBUG [config]: autoWatch set to false, because of singleRun DEBUG [plugin]: Loading karma-* from /home/utkarsh/angular_dev/test/node_modules DEBUG [plugin]: Loading plugin /home/utkarsh/angular_dev/test/node_modules/karma-chrome-launcher. DEBUG [plugin]: Loading plugin /home/utkarsh/angular_dev/test/node_modules/karma-firefox-launcher. DEBUG [plugin]: Loading plugin /home/utkarsh/angular_dev/test/node_modules/karma-jasmine. DEBUG [plugin]: Loading plugin /home/utkarsh/angular_dev/test/node_modules/karma-phantomjs-launcher. DEBUG [plugin]: Loading plugin /home/utkarsh/angular_dev/test/node_modules/karma-requirejs. INFO [karma]: Karma v0.12.25 server started at http://localhost:9876/ INFO [launcher]: Starting browser Firefox DEBUG [temp-dir]: Creating temp dir at /tmp/karma-45070576 DEBUG [launcher]: firefox http://localhost:9876/?id=45070576 -profile /tmp/karma-45070576 -no-remote DEBUG [watcher]: Resolved files: /home/utkarsh/angular_dev/test/node_modules/requirejs/require.js /home/utkarsh/angular_dev/test/node_modules/karma-requirejs/lib/adapter.js /home/utkarsh/angular_dev/test/node_modules/karma-jasmine/lib/jasmine.js /home/utkarsh/angular_dev/test/node_modules/karma-jasmine/lib/boot.js /home/utkarsh/angular_dev/test/node_modules/karma-jasmine/lib/adapter.js /home/utkarsh/angular_dev/test/test/spec/controllers/main.js DEBUG [web-server]: serving: /home/utkarsh/angular_dev/test/node_modules/karma/static/client.html DEBUG [web-server]: serving: /home/utkarsh/angular_dev/test/node_modules/karma/static/karma.js DEBUG [web-server]: upgrade /socket.io/1/websocket/TbSwGguo7AHttXkI5_qY DEBUG [karma]: A browser has connected on socket TbSwGguo7AHttXkI5_qY INFO [Firefox 33.0.0 (Ubuntu)]: Connected on socket TbSwGguo7AHttXkI5_qY with id 45070576 DEBUG [launcher]: Firefox (id 45070576) captured in 1.789 secs DEBUG [web-server]: serving: /home/utkarsh/angular_dev/test/node_modules/karma/static/context.html DEBUG [web-server]: serving (cached): /home/utkarsh/angular_dev/test/node_modules/requirejs/require.js DEBUG [web-server]: serving (cached): /home/utkarsh/angular_dev/test/test/spec/controllers/main.js DEBUG [web-server]: serving (cached): /home/utkarsh/angular_dev/test/node_modules/karma-requirejs/lib/adapter.js DEBUG [web-server]: serving (cached): /home/utkarsh/angular_dev/test/node_modules/karma-jasmine/lib/jasmine.js DEBUG [web-server]: serving (cached): /home/utkarsh/angular_dev/test/node_modules/karma-jasmine/lib/boot.js DEBUG [web-server]: serving (cached): /home/utkarsh/angular_dev/test/node_modules/karma-jasmine/lib/adapter.js WARN [Firefox 33.0.0 (Ubuntu)]: Disconnected (1 times), because no message in 10000 ms. DEBUG [karma]: Run complete, exiting. DEBUG [launcher]: Disconnecting all browsers DEBUG [launcher]: Process Firefox exited with code 0 DEBUG [temp-dir]: Cleaning temp dir /tmp/karma-45070576 Warning: Task "karma:unit" failed. Use --force to continue. Aborted due to warnings. Execution Time (2014-11-23 18:26:43 UTC) loading tasks 3ms 0% clean:server 5ms 0% concurrent:test 4.3s ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 26% autoprefixer:dist 112ms ▇▇ 1% connect:test 22ms 0% karma:unit 11.9s ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 73% Total 16.3s |
I also had similar issue, but found out that newly installed bower_components were not loaded. Don't know if generator is meant to add them to karma.conf.js automatically, but i added manually and it works now. |
please remove angular-scenario.js. |
@minmur I had a similar problem - missing includes in karma.conf as bower didn't add them automatically. Your comment saved me some trouble, thank you. |
Wow @MillerRen thanks so much for this. I was banging my head against the wall debugging karma (I inherited an old repo) and leaving angular-scenario in my bower.json was breaking my tests. |
I was able to fix this error by adding the following to my karma.conf.js file:
// list of files / patterns to exclude
The trick was to exclude angular-scenario.js, but I'm not sure why. If anyone knows, please share. Cheers! |
I mean, I know angular-mocks is for unit tests and angular-scenario is for end to end tests... so maybe a conf.js file cannot contain both without this error occurring.... Either way the error message needs to be improved. |
@Shawful Angular scenario runner is deprecated. You want to be using Protractor |
I don't understand. How exactly would I go about making the switch? |
Okay, so I found some docs (linked below). I imagine I would download the grunt-protractor runner using NPM (node package manager) from the command line, add the protractor task to my "grunt test" task list, and set it up to call it's own protractor config file and test files. Does that sound right? Grunt Protractor Runner - NPM Getting Started with Protractor |
oh and I would need to remove any references to angular-scenario.js from my original karma.conf.js file too. |
My team is working on AngularJS version 1.2.28 and hasn't made the move to 1.3.x yet. How do I find out if protractor works with 1.2.28? |
I have a persisten problem: Running "karma:unit" (karma) task Aborted due to warnings. I do not understand what is wrong here?? |
Still no solution, I have gone through all the suggestions above.. Chrome browser is opening and immediately closing..
Really appreciate any help. |
Still no fix? |
Doesn't run from command-line when autoWatch: false is set. Turned on singleRun: true, autoWatch: false. or autoWatch: true (<- still annoying) singleRun: false; |
From what I understand angular-fullstack generates both server tests for mocha and client tests for karma. For a newly generated app - after fixing both Gruntfile.js (see #247) and karma.conf.js (see #248) - I get following error when running
grunt test
:It's strange to read
Executed 0 of 0
since from what I understand there is a unit test. Does this mean that karma is failing to prepare test execution? How can I further investigate?Thanks in advance!
The text was updated successfully, but these errors were encountered: