Mocha - Chai Karma "not defined"

I am new to jscript tdd and got the problem, hope someone can show me what I'm doing worng. Running tests in a browser (via an HTML file) works fine. running them through node and karma, I got the following exception

I want to use Mocha and Chai in karma in the host node.js. I set through npm install [...] --save-dev mocha and karma mocha

I have a test library like this

suite('first suite', function () {
    test('SuccessTest', function () {
        expect(1).to.equal(1);
    });

    test('FailTest', function () {
        expect(1).to.equal(2);
    });
});

in node I used karma init to create a configuration file in which I set the framework for

frameworks: ['mocha','chai'],

now when i start karma he got this error enter image description here

"not determined"

I assumed that declaring mocha and chai as a framework should have worked?

I also installed karma mocha and karma chay plugins in node.

How am I mistaken and what should I do?

// Karma configuration
// Generated on Mon Sep 23 2013 17:24:19 GMT+0200 (Mitteleuropäische Sommerzeit)

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

    // base path, that will be used to resolve files and exclude
    basePath: '',


    // frameworks to use
    frameworks: ['mocha','chai'],


    // list of files / patterns to load in the browser
    files: [
      'tests.js'
    ],


    // list of files to exclude
    exclude: [

    ],


    // test results reporter to use
    // possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
    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: true,


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


    // If browser does not capture in given timeout [ms], kill it
    captureTimeout: 60000,


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

mocha.js chai.js ,

files: [
  'mocha.js',
  'chai.js',
  'tests.js'

],

, .

+3
1

, "chai" /, , , .

, "tdd" mocha ( "bdd" ):

// in config-mocha.js
window.mocha.setup({ui: 'tdd'});

"chai" :

module.exports = function(config) {
  config.set({
    files: [
      'path/to/chai.js',
      'config-mocha.js',
      // .. your source and test files
    ]
  });
};
+4

All Articles