mercredi 29 juillet 2015

Karma Jasmine: Executed 0 of 0 Error

I am getting into Angular Testing with Karma and Jasmine. After doing the karma init and writing the first test for a home controller, I keep getting Executed 0 of 0 ERROR. It does not seem like it's being picked up in the files.

module.exports = function(config) {
    config.set({

    basePath: '',

    frameworks: ['jasmine'],
    files: [
        'public/assets/libs/angular/angular.min.js',
        'bower_components/angular-mocks/angular-mocks.js',
        'public/app/app.module.js',
        'public/app/app.config.js',
        'public/app/**/*.js',
        'test/unit/**/*.spec.js'
    ],

    exclude: [
    ],

    preprocessors: {
    },

    reporters: ['progress'],

    port: 3030,

    colors: true,

    logLevel: config.LOG_INFO,

    autoWatch: true,

    browsers: ['Chrome'],

    singleRun: false

    }); //config.set
} //module.export

And the HomeController:

(function() {
'use strict';

angular
    .module('app')
    .controller('HomeController', HomeController);

HomeController.$inject = ['$scope', '$log'];

function HomeController($scope, $log) {
    /*jshint validthis: true*/
    var vm = this;

    vm.message = 'Hello World';

} //HomeController()

})(); //Controller

Thanks for helping.

Aucun commentaire:

Enregistrer un commentaire