2014-09-26 9 views
5

मैं इसे अपने जीवन के लिए समझने में सक्षम नहीं हूं, लेकिन मुझे अपने एंगुलर ऐप पर सही ढंग से चलाने के लिए मेरे परीक्षण प्राप्त करने में गंभीर समस्या हो रही है कि मैं काम कर रहा हूं पर। मैं जैस्मीन परीक्षण चलाने के लिए कर्म का उपयोग कर रहा हूं, और मेरी समस्या मेरे यूनिट परीक्षणों के साथ है। मुझे यकीन नहीं है कि क्या टूटा हुआ है, लेकिन मुझे पास करने के लिए कुछ यूनिट परीक्षण नहीं मिल सकते हैं। वे सभी ठीक से पास करते थे, लेकिन मैं यह पता लगाने में सक्षम नहीं हूं कि समस्या कहां है, लेकिन ऐसा लगता है जैसे मेरे नियंत्रकों को कर्म/चमेली में लोड नहीं किया जा रहा है।एंगुलरज में हमेशा-सही परीक्षण विफल हो जाते हैं - कर्म

यहाँ मेरी karma.conf.js फ़ाइल है:

// Karma configuration 
// http://karma-runner.github.io/0.12/config/configuration-file.html 
// Generated on 2014-09-26 using 
// generator-karma 0.8.3 

module.exports = function(config) { 
'use strict'; 

config.set({ 
// enable/disable watching file and executing tests whenever any file changes 
autoWatch: true, 

// 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: [ 
    '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-route/angular-route.js', 
    'bower_components/angular-sanitize/angular-sanitize.js', 
    'bower_components/angular-touch/angular-touch.js', 
    'bower_components/jquery/dist/jquery.min.js', 
    'app/scripts/*.js', 
    'app/scripts/**/*.js', 
    'test/mock/**/*.js', 
    'test/spec/**/*.js' 

], 

// list of files/patterns to exclude 
exclude: ['app/scripts/vendor.js'], 

// web server port 
port: 8080, 

// Start these browsers, currently available: 
// - Chrome 
// - ChromeCanary 
// - Firefox 
// - Opera 
// - Safari (only Mac) 
// - PhantomJS 
// - IE (only Windows) 
browsers: [ 
    'Firefox' 
], 

// Which plugins to enable 
plugins: [ 
    'karma-jasmine', 'karma-firefox-launcher', 'karma-coverage' 
], 

// Continuous Integration mode 
// if true, it capture browsers, run tests and exit 
singleRun: false, 

colors: true, 

// level of logging 
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG 
logLevel: config.LOG_DEBUG, 

// Uncomment the following lines if you are using grunt's server to run the tests 
// proxies: { 
// '/': 'http://localhost:9000/' 
// }, 
// URL root prevent conflicts with the site root 
// urlRoot: '_karma_' 
}); 
}; 

Package.json:

"devDependencies": { 
    "grunt": "^0.4.1", 
    "grunt-autoprefixer": "^0.7.3", 
    "grunt-concurrent": "^0.5.0", 
    "grunt-contrib-clean": "^0.5.0", 
    "grunt-contrib-compass": "^0.7.2", 
    "grunt-contrib-concat": "^0.4.0", 
    "grunt-contrib-connect": "^0.7.1", 
    "grunt-contrib-copy": "^0.5.0", 
    "grunt-contrib-cssmin": "^0.9.0", 
    "grunt-contrib-htmlmin": "^0.3.0", 
    "grunt-contrib-imagemin": "^0.7.0", 
    "grunt-contrib-jshint": "^0.10.0", 
    "grunt-contrib-uglify": "^0.4.0", 
    "grunt-contrib-watch": "^0.6.1", 
    "grunt-coveralls": "^1.0.0", 
    "grunt-filerev": "^0.2.1", 
    "grunt-google-cdn": "^0.4.0", 
    "grunt-karma": "^0.9.0", 
    "grunt-karma-coveralls": "^2.5.2", 
    "grunt-newer": "^0.7.0", 
    "grunt-ngmin": "^0.0.3", 
    "grunt-protractor-runner": "^1.1.4", 
    "grunt-protractor-webdriver": "^0.1.8", 
    "grunt-sauce-connect-launcher": "^0.3.0", 
    "grunt-svgmin": "^0.4.0", 
    "grunt-usemin": "^2.1.1", 
    "grunt-wiredep": "^1.7.0", 
    "jshint-stylish": "^0.2.0", 
    "karma": "^0.12.16", 
    "karma-chrome-launcher": "^0.1.4", 
    "karma-coverage": "^0.2.6", 
    "karma-firefox-launcher": "^0.1.3", 
    "karma-jasmine": "^0.1.5", 
    "karma-junit-reporter": "^0.2.2", 
    "karma-phantomjs-launcher": "^0.1.4", 
    "karma-safari-launcher": "^0.1.1", 
    "karma-sauce-launcher": "^0.2.10", 
    "load-grunt-tasks": "^0.4.0", 
    "phantomjs": "^1.9.9", 
    "protractor": "^1.3.0", 
    "time-grunt": "^0.3.1" 
    }, 
    "engines": { 
    "node": ">=0.10.0" 
    } 

उदाहरण परीक्षण:

'use strict'; 

describe('Controller: NotifyCtrl', function() { 

    // load the controller's module 
    beforeEach(module('goodStewardApp')); 

    var NotifyCtrl, 
    scope; 

    // Initialize the controller and a mock scope 
    beforeEach(inject(function ($controller, $rootScope) { 
    scope = $rootScope.$new(); 
    NotifyCtrl = $controller('NotifyCtrl', { 
     $scope: scope 
    }); 
    })); 

    it('should attach a list of awesomeThings to the scope', function() { 
    expect(true).toBe(true); 
    }); 
}); 

लॉग उत्पादन:

minErr/<@/Users/mthomas/Code/apps/pro-forma/bower_components/angular/angular.js:78:5 
    loadModules/<@/Users/mthomas/Code/apps/pro-forma/bower_components/angular/angular.js:3810:1 
    [email protected]/Users/mthomas/Code/apps/pro-forma/bower_components/angular/angular.js:323:7 
    [email protected]/Users/mthomas/Code/apps/pro-forma/bower_components/angular/angular.js:3775:5 
    [email protected]/Users/mthomas/Code/apps/pro-forma/bower_components/angular/angular.js:3715:3 
    [email protected]/Users/mthomas/Code/apps/pro-forma/bower_components/angular-mocks/angular-mocks.js:2142:9 

    TypeError: scope is undefined in /Users/mthomas/Code/apps/pro-forma/test/spec/controllers/slider.js (line 20) 
    @/Users/mthomas/Code/apps/pro-forma/test/spec/controllers/slider.js:20:5 
,210

LOG_DEBUG साथ कर्मा उत्पादन:

Running "karma:unit" (karma) task 
DEBUG [plugin]: Loading plugin karma-phantomjs-launcher. 
DEBUG [plugin]: Loading plugin karma-jasmine. 
DEBUG [plugin]: Loading plugin karma-firefox-launcher. 
INFO [karma]: Karma v0.12.23 server started at http://localhost:8080/ 
INFO [launcher]: Starting browser Firefox 
DEBUG [temp-dir]: Creating temp dir at /var/folders/n4/d26v17pn1sg45jvn1c29274c0000gn/T/karma-69625537 
DEBUG [launcher]: /Applications/Firefox.app/Contents/MacOS/firefox-bin http://localhost:8080/?id=69625537 -profile /var/folders/n4/d26v17pn1sg45jvn1c29274c0000gn/T/karma-69625537 -no-remote 
DEBUG [watcher]: Excluded file "/Users/mthomas/Code/apps/pro-forma/app/scripts/vendor.js" 
DEBUG [watcher]: Excluded file "/Users/mthomas/Code/apps/pro-forma/app/scripts/vendor.js" 
DEBUG [watcher]: Resolved files: 
    /Users/mthomas/Code/apps/pro-forma/node_modules/karma-jasmine/lib/jasmine.js 
    /Users/mthomas/Code/apps/pro-forma/node_modules/karma-jasmine/lib/adapter.js 
    /Users/mthomas/Code/apps/pro-forma/bower_components/angular/angular.js 
    /Users/mthomas/Code/apps/pro-forma/bower_components/angular-mocks/angular-mocks.js 
    /Users/mthomas/Code/apps/pro-forma/bower_components/angular-animate/angular-animate.js 
    /Users/mthomas/Code/apps/pro-forma/bower_components/angular-cookies/angular-cookies.js 
    /Users/mthomas/Code/apps/pro-forma/bower_components/angular-resource/angular-resource.js 
    /Users/mthomas/Code/apps/pro-forma/bower_components/angular-route/angular-route.js 
    /Users/mthomas/Code/apps/pro-forma/bower_components/angular-sanitize/angular-sanitize.js 
    /Users/mthomas/Code/apps/pro-forma/bower_components/angular-touch/angular-touch.js 
    /Users/mthomas/Code/apps/pro-forma/bower_components/jquery/dist/jquery.min.js 
    /Users/mthomas/Code/apps/pro-forma/app/scripts/app.js 
    /Users/mthomas/Code/apps/pro-forma/app/scripts/controllers/amount.js 
    /Users/mthomas/Code/apps/pro-forma/app/scripts/controllers/form.js 
    /Users/mthomas/Code/apps/pro-forma/app/scripts/controllers/main.js 
    /Users/mthomas/Code/apps/pro-forma/app/scripts/controllers/notify.js 
    /Users/mthomas/Code/apps/pro-forma/app/scripts/controllers/slider.js 
    /Users/mthomas/Code/apps/pro-forma/app/scripts/controllers/submit.js 
    /Users/mthomas/Code/apps/pro-forma/app/scripts/controllers/tribute.js 
    /Users/mthomas/Code/apps/pro-forma/app/scripts/services/donation.js 
    /Users/mthomas/Code/apps/pro-forma/app/scripts/services/giftfold.js 
    /Users/mthomas/Code/apps/pro-forma/test/mock/donationMock.js 
    /Users/mthomas/Code/apps/pro-forma/test/spec/amount.js 
    /Users/mthomas/Code/apps/pro-forma/test/spec/appSpec.js 
    /Users/mthomas/Code/apps/pro-forma/test/spec/controllers/form.js 
    /Users/mthomas/Code/apps/pro-forma/test/spec/controllers/main.js 
    /Users/mthomas/Code/apps/pro-forma/test/spec/controllers/notify.js 
    /Users/mthomas/Code/apps/pro-forma/test/spec/controllers/slider.js 
    /Users/mthomas/Code/apps/pro-forma/test/spec/controllers/submit.js 
    /Users/mthomas/Code/apps/pro-forma/test/spec/controllers/tribute.js 
    /Users/mthomas/Code/apps/pro-forma/test/spec/services/giftfold.js 
    /Users/mthomas/Code/apps/pro-forma/test/spec/services/panepasser.js 
DEBUG [watcher]: Watching "/Users/mthomas/Code/apps/pro-forma/bower_components/angular/angular.js" 
DEBUG [watcher]: Watching "/Users/mthomas/Code/apps/pro-forma/bower_components/angular-mocks/angular-mocks.js" 
DEBUG [watcher]: Watching "/Users/mthomas/Code/apps/pro-forma/bower_components/angular-animate/angular-animate.js" 
DEBUG [watcher]: Watching "/Users/mthomas/Code/apps/pro-forma/bower_components/angular-cookies/angular-cookies.js" 
DEBUG [watcher]: Watching "/Users/mthomas/Code/apps/pro-forma/bower_components/angular-resource/angular-resource.js" 
DEBUG [watcher]: Watching "/Users/mthomas/Code/apps/pro-forma/bower_components/angular-route/angular-route.js" 
DEBUG [watcher]: Watching "/Users/mthomas/Code/apps/pro-forma/bower_components/angular-sanitize/angular-sanitize.js" 
DEBUG [watcher]: Watching "/Users/mthomas/Code/apps/pro-forma/bower_components/angular-touch/angular-touch.js" 
DEBUG [watcher]: Watching "/Users/mthomas/Code/apps/pro-forma/bower_components/jquery/dist/jquery.min.js" 
DEBUG [watcher]: Watching "/Users/mthomas/Code/apps/pro-forma/app/scripts" 
DEBUG [watcher]: Watching "/Users/mthomas/Code/apps/pro-forma/test/mock" 
DEBUG [watcher]: Watching "/Users/mthomas/Code/apps/pro-forma/test/spec" 
DEBUG [watcher]: Add file "/Users/mthomas/Code/apps/pro-forma/bower_components/angular-mocks/angular-mocks.js" ignored. Already in the list. 
DEBUG [watcher]: Add file "/Users/mthomas/Code/apps/pro-forma/bower_components/angular-animate/angular-animate.js" ignored. Already in the list. 
DEBUG [watcher]: Add file "/Users/mthomas/Code/apps/pro-forma/bower_components/angular-resource/angular-resource.js" ignored. Already in the list. 
DEBUG [watcher]: Add file "/Users/mthomas/Code/apps/pro-forma/bower_components/angular-cookies/angular-cookies.js" ignored. Already in the list. 
DEBUG [watcher]: Add file "/Users/mthomas/Code/apps/pro-forma/bower_components/angular-route/angular-route.js" ignored. Already in the list. 
DEBUG [watcher]: Add file "/Users/mthomas/Code/apps/pro-forma/bower_components/angular-sanitize/angular-sanitize.js" ignored. Already in the list. 
DEBUG [watcher]: Add file "/Users/mthomas/Code/apps/pro-forma/bower_components/angular-touch/angular-touch.js" ignored. Already in the list. 
DEBUG [watcher]: Add file "/Users/mthomas/Code/apps/pro-forma/bower_components/jquery/dist/jquery.min.js" ignored. Already in the list. 
DEBUG [watcher]: Add file "/Users/mthomas/Code/apps/pro-forma/app/scripts/app.js" ignored. Already in the list. 
DEBUG [watcher]: Add file "/Users/mthomas/Code/apps/pro-forma/test/mock/donationMock.js" ignored. Already in the list. 
DEBUG [watcher]: Add file "/Users/mthomas/Code/apps/pro-forma/test/spec/amount.js" ignored. Already in the list. 
DEBUG [watcher]: Add file "/Users/mthomas/Code/apps/pro-forma/test/spec/appSpec.js" ignored. Already in the list. 
DEBUG [watcher]: Add file "/Users/mthomas/Code/apps/pro-forma/app/scripts/services/donation.js" ignored. Already in the list. 
DEBUG [watcher]: Add file "/Users/mthomas/Code/apps/pro-forma/app/scripts/services/giftfold.js" ignored. Already in the list. 
DEBUG [watcher]: Add file "/Users/mthomas/Code/apps/pro-forma/app/scripts/controllers/amount.js" ignored. Already in the list. 
DEBUG [watcher]: Add file "/Users/mthomas/Code/apps/pro-forma/app/scripts/controllers/form.js" ignored. Already in the list. 
DEBUG [watcher]: Add file "/Users/mthomas/Code/apps/pro-forma/app/scripts/controllers/main.js" ignored. Already in the list. 
DEBUG [watcher]: Add file "/Users/mthomas/Code/apps/pro-forma/app/scripts/controllers/notify.js" ignored. Already in the list. 
DEBUG [watcher]: Add file "/Users/mthomas/Code/apps/pro-forma/app/scripts/controllers/slider.js" ignored. Already in the list. 
DEBUG [watcher]: Add file "/Users/mthomas/Code/apps/pro-forma/app/scripts/controllers/submit.js" ignored. Already in the list. 
DEBUG [watcher]: Add file "/Users/mthomas/Code/apps/pro-forma/app/scripts/controllers/tribute.js" ignored. Already in the list. 
DEBUG [watcher]: Add file "/Users/mthomas/Code/apps/pro-forma/test/spec/services/giftfold.js" ignored. Already in the list. 
DEBUG [watcher]: Add file "/Users/mthomas/Code/apps/pro-forma/test/spec/services/panepasser.js" ignored. Already in the list. 
DEBUG [watcher]: Add file "/Users/mthomas/Code/apps/pro-forma/test/spec/controllers/form.js" ignored. Already in the list. 
DEBUG [watcher]: Add file "/Users/mthomas/Code/apps/pro-forma/test/spec/controllers/main.js" ignored. Already in the list. 
DEBUG [watcher]: Add file "/Users/mthomas/Code/apps/pro-forma/test/spec/controllers/notify.js" ignored. Already in the list. 
DEBUG [watcher]: Add file "/Users/mthomas/Code/apps/pro-forma/test/spec/controllers/slider.js" ignored. Already in the list. 
DEBUG [watcher]: Add file "/Users/mthomas/Code/apps/pro-forma/test/spec/controllers/submit.js" ignored. Already in the list. 
DEBUG [watcher]: Add file "/Users/mthomas/Code/apps/pro-forma/test/spec/controllers/tribute.js" ignored. Already in the list. 
DEBUG [web-server]: serving: /Users/mthomas/Code/apps/pro-forma/node_modules/karma/static/client.html 
DEBUG [web-server]: serving: /Users/mthomas/Code/apps/pro-forma/node_modules/karma/static/karma.js 
DEBUG [web-server]: upgrade /socket.io/1/websocket/z06OOVspj9-9RTFD7gAP 
DEBUG [karma]: A browser has connected on socket z06OOVspj9-9RTFD7gAP 
INFO [Firefox 32.0.0 (Mac OS X 10.10)]: Connected on socket z06OOVspj9-9RTFD7gAP with id 69625537 
DEBUG [launcher]: Firefox (id 69625537) captured in 1.723 secs 
DEBUG [karma]: All browsers are ready, executing 
DEBUG [web-server]: serving: /Users/mthomas/Code/apps/pro-forma/node_modules/karma/static/context.html 
DEBUG [web-server]: serving (cached): /Users/mthomas/Code/apps/pro-forma/node_modules/karma-jasmine/lib/jasmine.js 
DEBUG [web-server]: serving (cached): /Users/mthomas/Code/apps/pro-forma/node_modules/karma-jasmine/lib/adapter.js 
DEBUG [web-server]: serving (cached): /Users/mthomas/Code/apps/pro-forma/bower_components/angular/angular.js 
DEBUG [web-server]: serving (cached): /Users/mthomas/Code/apps/pro-forma/bower_components/angular-mocks/angular-mocks.js 
DEBUG [web-server]: serving (cached): /Users/mthomas/Code/apps/pro-forma/bower_components/angular-animate/angular-animate.js 
DEBUG [web-server]: serving (cached): /Users/mthomas/Code/apps/pro-forma/bower_components/angular-cookies/angular-cookies.js 
DEBUG [web-server]: serving (cached): /Users/mthomas/Code/apps/pro-forma/bower_components/angular-resource/angular-resource.js 
DEBUG [web-server]: serving (cached): /Users/mthomas/Code/apps/pro-forma/bower_components/angular-route/angular-route.js 
DEBUG [web-server]: serving (cached): /Users/mthomas/Code/apps/pro-forma/bower_components/angular-sanitize/angular-sanitize.js 
DEBUG [web-server]: serving (cached): /Users/mthomas/Code/apps/pro-forma/bower_components/angular-touch/angular-touch.js 
DEBUG [web-server]: serving (cached): /Users/mthomas/Code/apps/pro-forma/bower_components/jquery/dist/jquery.min.js 
DEBUG [web-server]: serving (cached): /Users/mthomas/Code/apps/pro-forma/app/scripts/app.js 
DEBUG [web-server]: serving (cached): /Users/mthomas/Code/apps/pro-forma/app/scripts/controllers/amount.js 
DEBUG [web-server]: serving (cached): /Users/mthomas/Code/apps/pro-forma/app/scripts/controllers/form.js 
DEBUG [web-server]: serving (cached): /Users/mthomas/Code/apps/pro-forma/app/scripts/controllers/main.js 
DEBUG [web-server]: serving (cached): /Users/mthomas/Code/apps/pro-forma/app/scripts/controllers/notify.js 
DEBUG [web-server]: serving (cached): /Users/mthomas/Code/apps/pro-forma/app/scripts/controllers/slider.js 
DEBUG [web-server]: serving (cached): /Users/mthomas/Code/apps/pro-forma/app/scripts/controllers/submit.js 
DEBUG [web-server]: serving (cached): /Users/mthomas/Code/apps/pro-forma/app/scripts/controllers/tribute.js 
DEBUG [web-server]: serving (cached): /Users/mthomas/Code/apps/pro-forma/app/scripts/services/donation.js 
DEBUG [web-server]: serving (cached): /Users/mthomas/Code/apps/pro-forma/app/scripts/services/giftfold.js 
DEBUG [web-server]: serving: /Users/mthomas/Code/apps/pro-forma/test/mock/donationMock.js 
DEBUG [web-server]: serving (cached): /Users/mthomas/Code/apps/pro-forma/test/spec/amount.js 
DEBUG [web-server]: serving (cached): /Users/mthomas/Code/apps/pro-forma/test/spec/appSpec.js 
DEBUG [web-server]: serving (cached): /Users/mthomas/Code/apps/pro-forma/test/spec/controllers/form.js 
DEBUG [web-server]: serving (cached): /Users/mthomas/Code/apps/pro-forma/test/spec/controllers/main.js 
DEBUG [web-server]: serving (cached): /Users/mthomas/Code/apps/pro-forma/test/spec/controllers/notify.js 
DEBUG [web-server]: serving (cached): /Users/mthomas/Code/apps/pro-forma/test/spec/controllers/slider.js 
DEBUG [web-server]: serving (cached): /Users/mthomas/Code/apps/pro-forma/test/spec/controllers/submit.js 
DEBUG [web-server]: serving (cached): /Users/mthomas/Code/apps/pro-forma/test/spec/controllers/tribute.js 
DEBUG [web-server]: serving (cached): /Users/mthomas/Code/apps/pro-forma/test/spec/services/giftfold.js 
DEBUG [web-server]: serving (cached): /Users/mthomas/Code/apps/pro-forma/test/spec/services/panepasser.js 
Firefox 32.0.0 (Mac OS X 10.10) Controller: AmountCtrl Should create have a working controller FAILED 
    minErr/<@/Users/mthomas/Code/apps/pro-forma/bower_components/angular/angular.js:78:5 
    loadModules/<@/Users/mthomas/Code/apps/pro-forma/bower_components/angular/angular.js:3810:1 
    [email protected]/Users/mthomas/Code/apps/pro-forma/bower_components/angular/angular.js:323:7 
    [email protected]/Users/mthomas/Code/apps/pro-forma/bower_components/angular/angular.js:3775:5 
    [email protected]/Users/mthomas/Code/apps/pro-forma/bower_components/angular/angular.js:3715:3 
    [email protected]/Users/mthomas/Code/apps/pro-forma/bower_components/angular-mocks/angular-mocks.js:2142:9 

    Expected undefined to be defined. 
    @/Users/mthomas/Code/apps/pro-forma/test/spec/amount.js:23:5 

Slider.js:

"minErr/<@http://localhost:8080/base/bower_components/angular/angular.js:78:5 
loadModules/<@http://localhost:8080/base/bower_components/angular/angular.js:3810:1 
[email protected]://localhost:8080/base/bower_components/angular/angular.js:323:7 
[email protected]://localhost:8080/base/bower_components/angular/angular.js:3775:5 
[email protected]://localhost:8080/base/bower_components/angular/angular.js:3715:3 
[email protected]://localhost:8080/base/bower_components/angular-mocks/angular-mocks.js:2142:9 
[email protected]://localhost:8080/base/node_modules/karma-jasmine/lib/jasmine.js:1145:7 
[email protected]://localhost:8080/base/node_modules/karma-jasmine/lib/jasmine.js:2177:7 
[email protected]://localhost:8080/base/node_modules/karma-jasmine/lib/jasmine.js:2130:3 
[email protected]://localhost:8080/base/node_modules/karma-jasmine/lib/jasmine.js:2458:3 
[email protected]://localhost:8080/base/node_modules/karma-jasmine/lib/jasmine.js:2177:7 
[email protected]://localhost:8080/base/node_modules/karma-jasmine/lib/jasmine.js:2130:3 
[email protected]://localhost:8080/base/node_modules/karma-jasmine/lib/jasmine.js:2604:3 
[email protected]://localhost:8080/base/node_modules/karma-jasmine/lib/jasmine.js:2177:7 
jasmine.Queue.prototype.next_/[email protected]://localhost:8080/base/node_modules/karma-jasmine/lib/jasmine.js:2173:13 
[email protected]://localhost:8080/base/node_modules/karma-jasmine/lib/jasmine.js:2561:5 
jasmine.Suite.prototype.execute/<@http://localhost:8080/base/node_modules/karma-jasmine/lib/jasmine.js:2605:5 
[email protected]://localhost:8080/base/node_modules/karma-jasmine/lib/jasmine.js:2187:9 
jasmine.Queue.prototype.next_/[email protected]://localhost:8080/base/node_modules/karma-jasmine/lib/jasmine.js:2173:13 
[email protected]://localhost:8080/base/node_modules/karma-jasmine/lib/jasmine.js:2432:5 
jasmine.Spec.prototype.execute/<@http://localhost:8080/base/node_modules/karma-jasmine/lib/jasmine.js:2459:5 
[email protected]://localhost:8080/base/node_modules/karma-jasmine/lib/jasmine.js:2187:9 
jasmine.Queue.prototype.next_/onComplete/<@http://localhost:8080/base/node_modules/karma-jasmine/lib/jasmine.js:2167:13 

मैं एप्लिकेशन की निर्भरता का परीक्षण कर सकते हैं: ब्राउज़र में कर्म डिबग धावक से

'use strict'; 

/** 
* @ngdoc function 
* @name goodStewardApp.controller:SliderCtrl 
* @description 
* # SliderCtrl 
* Controller of the goodStewardApp 
*/ 
angular.module('goodStewardApp') 
    .controller('SliderCtrl', function($scope, Donation) { 

    $scope.donation = Donation; 


    // set the default slide, and the upper and lower bounds so we know how many slides we have 
    $scope.activeSlide = 0; 
    var slidesUpperBound = 2; 
    var slidesLowerBound = 0; 

    $scope.moveSlide = function(direction) { 
     if (direction === 'left') { 
     if ($scope.activeSlide <= slidesUpperBound && $scope.activeSlide > 
      slidesLowerBound) { 
      $scope.activeSlide--; 
     } else { 
      $scope.activeSlide = 0; 
     } 
     } else if (direction === 'right') { 
     if ($scope.activeSlide <= slidesUpperBound - 1) { 
      $scope.activeSlide++; 
     } else { 
      // if we go too high, we return to zero 
      $scope.activeSlide = 0; 
     } 

     } 
    }; 

    // end slides logic 


    }); 

नमूना सामग्री बस ठीक है, लेकिन अन्य परीक्षण हमेशा-सही स्थितियों पर भी पारित नहीं होंगे। मैंने कोणीय, समाशोधन कैश को डाउनग्रेड करने का प्रयास किया है, यह सुनिश्चित कर रहा हूं कि मेरी सभी फाइलें शामिल हैं (अभी भी वही त्रुटि), डीबग स्तर को बदलना, लेकिन कुछ भी काम नहीं किया है। कोई मदद अद्भुत होगी! धन्यवाद!

+0

यदि परीक्षण चल रहे थे तो आपके द्वारा संपादित किया गया कुछ टूटा जाना चाहिए। क्या आपने एक समय में कुछ फ़ाइलों को अनलोड करने का प्रयास किया है जब तक कि आप पिन-पॉइंट न करें जहां समस्या हो सकती है। – chriskelly

+1

क्या आप '/ उपयोगकर्ता/mthomas/code/apps/pro-forma/test/spec/controllers/slider.js' की सामग्री भी शामिल कर सकते हैं? – Kristian

+0

ऊपर वर्णित त्रुटि क्रिस्टियन ऊपर वर्णित नियंत्रक में "स्कोप अपरिभाषित" सहेजती है। आप शायद '$ स्कोप 'टाइप करना चाहते थे? –

उत्तर

0

कर्म conf फ़ाइल से app/scripts/*.js बाहर निकालें।

0

आसपास karma-unit.tpl.js

में src/**/*.js को दूर करने के लिए एक अस्थायी शब्द के रूप में करने के बाद,

browsers: [ 
    'Firefox' 
] 

browsers: [ 
    'firefox' 
] 

को बदल सकते हैं और graunt घड़ी चलाते हैं।

ब्राउज़र नाम के गलत मिलान का सवाल है, अगर यह प्लगइन्स के लिए पूछता है, ctrl + दबाएँ।

संबंधित मुद्दे