Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unused devDependencies with Karma #188

Closed
screendriver opened this issue Dec 1, 2016 · 4 comments
Closed

Unused devDependencies with Karma #188

screendriver opened this issue Dec 1, 2016 · 4 comments
Labels

Comments

@screendriver
Copy link

I am using Karma and Webpack for my unit tests. Unfortunately depcheck v0.6.6 tells me

Unused devDependencies
* babel-core
* babel-loader
* babel-polyfill
* karma-chrome-launcher
* karma-coverage
* karma-mocha
* karma-mocha-reporter
* karma-teamcity-reporter
* karma-webpack
* mocha
* webpack

karma.conf.js

// Karma configuration
// Generated on Thu Aug 18 2016 11:47:04 GMT+0200 (CEST)

module.exports = (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'],


    client: {
      mocha: {
        // change Karma's debug.html to the mocha web reporter
        reporter: 'html',
      },
    },


    // list of files / patterns to load in the browser
    files: [
      'node_modules/babel-polyfill/dist/polyfill.js',
      { pattern: 'test/**/*.test.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/**/*.test.js': ['webpack'],
    },


    webpack: {
      devtool: 'inline-source-map',
      externals: [{
        chcp: true,
        device: true,
      }],
      module: {
        loaders: [{
          test: /\.js$/,
          exclude: /node_modules/,
          loader: 'babel',
        }],
      },
    },


    // test results reporter to use
    // possible values: 'dots', 'progress'
    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
    reporters: (process.env.TEAMCITY_VERSION
       ? ['teamcity']
       : ['progress', 'mocha'])
       .concat(['coverage']),


    coverageReporter: {
      reporters: [
         { type: 'html', dir: 'coverage/', subdir: '.' },
         { type: 'text-summary' },
      ].concat(process.env.TEAMCITY_VERSION ? [{ type: 'teamcity' }] : []),
    },


    // 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: ['Chrome'],


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

    // Concurrency level
    // how many browser should be started simultaneous
    concurrency: Infinity,
  });
};
@lijunle
Copy link
Member

lijunle commented Dec 1, 2016

I don't think that current depcheck is parsing karma config file to extract the webpack loaders. Let me add it to the backlog.

@screendriver
Copy link
Author

Ok. Thank you.

@lijunle lijunle added the feature label Dec 5, 2016
@NtgJoshi
Copy link

NtgJoshi commented Dec 6, 2017

+1

@rjatkins rjatkins mentioned this issue Jan 23, 2019
@rumpl
Copy link
Member

rumpl commented Jan 25, 2019

Karma support is merged now.

@rumpl rumpl closed this as completed Jan 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants