Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Not getting coverage output #10

Closed
tinkertrain opened this issue May 15, 2015 · 1 comment
Closed

Not getting coverage output #10

tinkertrain opened this issue May 15, 2015 · 1 comment

Comments

@tinkertrain
Copy link

Hello!

I looked for an answer for this and tried multiple things... but I can't get code coverage working, maybe someone can shed a light into what this isn't working:

This is the karma conf file:

/* eslint-disable no-var */
var path = require('path');

module.exports = function (config) {
  config.set({
    basePath: '',
    frameworks: ['jasmine', 'sinon'],
    files: [
      './test/**/*.js'
    ],
    preprocessors: {
      './test/**/*.js': ['webpack']
    },
    webpack: {
      module: {
        loaders: [
          {
            test: /\.js?$/,
            loaders: ['babel-loader'],
            exclude: /node_modules/
          }
        ],
        postLoaders: [
          {
            test: /\.js$/,
            loaders: ['istanbul-instrumenter'],
            exclude: /(test|node_modules)\//
          }
        ]
      },
      resolve: {
        root: [
          path.join(__dirname, 'src'),
          'node_modules'
        ]
      }
    },
    webpackMiddleware: {
      noInfo: true
    },
    plugins: [
      require('karma-webpack'),
      require('karma-jasmine'),
      require('karma-chrome-launcher'),
      require('karma-phantomjs-launcher'),
      require('karma-coverage'),
      require('karma-sinon'),
      'karma-nyan-reporter',
      'istanbul-instrumenter-loader'
    ],
    reporters: ['nyan', 'coverage'],
    nyanReporter: {
      suppressErrorReport: false
    },
    coverageReporter: {
      type: 'html',
      dir: 'coverage/'
    },
    port: 9876,
    colors: true,
    logLevel: config.LOG_INFO,
    autoWatch: true,
    browsers: ['PhantomJS'],
    singleRun: false
  });
};

When I run karma I don't errors and the tests are being run, but I don't get a folder 'coverage' nor html files created... did I missed something obvious? (this is the first time I'm trying Istanbul code coverage btw)

Thanks!

@tinkertrain
Copy link
Author

Oh no! I saw is there sorry for wasting anyone's time (for some reason it was hidden)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant