Coder Social home page Coder Social logo

Comments (6)

4kochi avatar 4kochi commented on May 18, 2024

I am not sure if it's a problem with the reporter, because it is registered as reporter

'reporter:mocha'

It seems more like the testing framework mocha is missing. (karma-mocha)

Can you please share your complete config for further investigations.

from karma-mocha-reporter.

mikeerickson avatar mikeerickson commented on May 18, 2024

Here you go (and karma-mocha is installed). It all works fine so long as I dont reference it in the plugin. Also included a screenshot of installed modules

// karma.conf.js
// Created: 5/9/2016 1:07 PM
// =============================================================================

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: ['mocha','sinon','chai-things','chai'],


    // list of files / patterns to load in the browser
    files: [
      'node_modules/angular/angular.js',
      'node_modules/angular-mocks/angular-mocks.js',
      'dist/bundle.js',
      'src/**/*.spec.js',
      'dist/_index.html',
    ],


    // 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: {
      'src/**/*.html': ['ng-html2js'],
      'src/**/!(*.mock|*.spec).js': ['coverage']
    },


    ngHtml2JsPreprocessor: {
      // strip this from the file path
      stripPrefix: 'src/',
      // create a single module that contains templates from all the files
      moduleName: 'templates'
    },


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


    superDotsReporter: {
      icon: {
        success : ' ✔ ',
        failure : ' ✖ ',
        ignore  : ' ℹ '
      }
    },

    coverageReporter: {
      type : 'html',
      dir : 'coverage/'
    },


    // 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
    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
    browsers: ['PhantomJS'],


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

karma-modules

from karma-mocha-reporter.

4kochi avatar 4kochi commented on May 18, 2024

Could it be that your plugins section looks like this:

plugins: [
  'karma-mocha-reporter'
]

If so, karma only loads the reporter plugin but not the others, so karma-mocha is not loaded. So either you remove the plugin section from the config and karma takes care of loading all plugins. Or if you specify the plugins section, you have to enter all plugin names.

from karma-mocha-reporter.

mikeerickson avatar mikeerickson commented on May 18, 2024

Yep, that seemed to be the issue. Just had to specifically list all the plugins and all worked.

But, the reporter doesnt look much different than the existing mocha reporter karma-mocha?

from karma-mocha-reporter.

4kochi avatar 4kochi commented on May 18, 2024

I am not aware that karma-mocha ships it's own reporter. I thought it's only the test framework and the default karma reporter is used.

from karma-mocha-reporter.

mikeerickson avatar mikeerickson commented on May 18, 2024

@4kochi yes, you are indeed correct. My bad ;-)

from karma-mocha-reporter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.