Configurare Karma si Jasmine pentru unit testing in AngularJS

Am instalat test runner Karma, cu el am configurat ca proiectul cu angularjs la care lucrez sa foloseasca framework de testare Jasmine. Am scris un dumb test si a mers perfect, probemele au inceput sa apara cand am incercat sa testez chestiile de angular, nu stiu ce nu includ corect si in ce ordine ca imi da erori cand rulez testele legate de angular.

karma.conf.js

// Karma configuration
// Generated on Mon Nov 02 2015 16:59:29 GMT+0200 (GTB Standard Time)

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

    // base path that will be used to resolve all patterns (eg. files, exclude)
    basePath: '',


    // frameworks to use
    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
    frameworks: ['jasmine'],


    // list of files / patterns to load in the browser
    files: [
        /*'lib/angular/angular.js',
        'lib/angular/angular-mocks/angular-mocks.js',
        'app/config.js',
        'test/helloSpec.js',
        'test/controllers/channels/generic/addEditChannelPointerGenericControllerSpec.js'*/

        'lib/angular/angular.js',
        'lib/angular/angular-mocks/angular-mocks.js',
        'app/config.js',
        'app/directives/*.js',
        'app/app.js',
        'app/controllers/*.js',
        'app/services/*.js',
        'app/*',
        //'test/spec/**/*.js',
        'test/helloSpec.js',
        'test/controllers/channels/generic/addEditChannelPointerGenericControllerSpec.js'
    ],


    // list of files to exclude
    exclude: [
    ],


    // preprocess matching files before serving them to the browser
    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
    preprocessors: {
    },


    // test results reporter to use
    // possible values: 'dots', 'progress'
    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
    reporters: ['progress'],


    // web server port
    port: 9876,


    // enable / disable colors in the output (reporters and logs)
    colors: true,


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


    // enable / disable watching file and executing tests whenever any file changes
    autoWatch: false,


    // start these browsers
    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
    browsers: ['Chrome'],


    // Continuous Integration mode
    // if true, Karma captures browsers, runs the tests and exits
    singleRun: false,

    // Concurrency level
    // how many browser should be started simultanous
    concurrency: Infinity
  })
}

Eroare Angular la consola cand rulez testul:

Uncaught Error: [$injector:nomod] Module ‘app’ is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
AngularJS
at http://localhost:9876/base/lib/angular/angular.js?8a3b01d48be534d912d942c7b1820b9b2946830f:1767

Testul legat de angular de la care apar probleme:

describe("addEditChannelPointerGenericController", function() {
    var addEditChannelPointerGenericController;
    beforeEach(angular.mock.module("app"));
    beforeEach(inject(function($controller) {
        addEditChannelPointerGenericController = $controller("addEditChannelPointerGenericController")
    }))

    describe("addEditChannelPointerGenericController", function() {
        it("should check message on controller scope", function() {
            expect(addEditChannelPointerGenericController.message).toBe("Hello");
        })
    })

})

Am facut si un test dumb care trece:

describe("hello", function() {
    it("spect should work", function() {
        expect(true).toBe(true);
    })
})

in loc de:

module(“app”);

& some info