karma-test-suite
We all use the same tools to test across all of our different repositories. With the
karma-test-suite
, you can keep your dependency chain clean by only having to install one package and use karma as you would normally!
This suite includes:
- karma
- mocha
- chai
- sinon
- isparta code coverage
- phantomjs launcher
- webpack
- ignore-loader (to process files that include scss)
Here's an example karma.config:
basePath: '' browsers: 'PhantomJS' client: mocha: ui: 'bdd' colors: true files: // your files here! // example_file.js frameworks: 'mocha' 'chai-sinon' plugins: 'karma-chai-sinon' 'karma-mocha' 'karma-phantomjs-launcher' 'karma-sourcemap-loader' 'karma-webpack' port: 9876 preprocessors: 'example_file.js': 'webpack' 'sourcemap' reporters: 'dots' phantomjsLauncher: exitOnResourceError: true webpack: module: loaders: test: /\.js$/ loader: 'babel-loader' exclude: /node_modules/ test: /\.$/ loader: 'ignore-loader' resolve: extensions: '' '.js' '.jsx' externals: 'react/lib/ExecutionEnvironment': true 'react/lib/ReactContext': true webpackMiddleware: noInfo: true