Sunday 15 July 2012

Grunt Karma unit task fail with AngularJS project -



Grunt Karma unit task fail with AngularJS project -

i have problem executing grunt karma:unit, task finished throw this:

....... debug [web-server]: serving (cached): c:/project/yo /test/spec/services/lists.js firefox 32.0.0 (windows 7): executed 0 of 0 error (0.027 secs / 0 secs) debug [karma]: run complete, exiting. debug [launcher]: disconnecting browsers debug [launcher]: process firefox exited code 0 debug [temp-dir]: cleaning temp dir c:\users\developer\appdata\local\temp\karma-14 854612 warning: task "karma:unit" failed. utilize --force continue. aborted due warnings. execution time (2014-10-16 21:25:51 utc) karma:unit 4.1s ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 100% total 4.1s

the test directory contains test empty, example:

'use strict'; describe('service: lists', function () { });

i don't understand why result is: warning: task "karma:unit" failed. utilize --force continue..

my karma.conf.js file contains:

module.exports = function(config) { 'use strict'; config.set({ autowatch: true, basepath: '../', // testing framework utilize (jasmine/mocha/qunit/...) frameworks: ['jasmine'], // list of files / patterns load in browser files: [ 'app/bower_components/jquery/dist/jquery.js', 'app/bower_components/angular/angular.js', 'app/bower_components/json3/lib/json3.js', 'app/bower_components/bootstrap/dist/js/bootstrap.js', 'app/bower_components/jquery-ui/jquery-ui.js', 'app/bower_components/angular-animate/angular-animate.js', 'app/bower_components/angular-route/angular-route.js', 'app/bower_components/angular-sanitize/angular-sanitize.js', 'app/bower_components/angular-touch/angular-touch.js', 'app/bower_components/lodash/dist/lodash.compat.js', 'app/bower_components/restangular/dist/restangular.js', 'app/bower_components/angular-ui-router/release/angular-ui-router.js', 'app/bower_components/angular-bootstrap/ui-bootstrap-tpls.js', 'app/bower_components/angular-translate/angular-translate.js', 'app/bower_components/angular-moment/angular-moment.js', 'app/bower_components/angular-ui-router/release/angular-ui-router.js', 'app/bower_components/angular-translate-loader-static-files/angular-translate-loader-static-files.js', 'app/scripts/**/*.js', 'test/spec/**/*.js' ], exclude: [], port: 8080, browsers: [ 'firefox' ], plugins: [ 'karma-firefox-launcher', 'karma-jasmine' ], singlerun: false, colors: true, loglevel: config.log_debug, }); };

karma needs at to the lowest degree 1 test create work/succeed. take in debug output:

firefox 32.0.0 (windows 7): executed 0 of 0 error (0.027 secs / 0 secs)

once add 1 test, work:

firefox 32.0.0 (windows 7): executed 1 of 1 error (0.031 secs / 0 secs)

how create console log , error's displayed in console output while running test?

please add together progress param karma configuration file.

you can read in documentation here: http://karma-runner.github.io/0.8/config/configuration-file.html

reporters: ['progress'],

angularjs unit-testing e2e-testing

No comments:

Post a Comment