How to debug single Karma test using WebStorm -
i trying debug single test using karma , webstorm. found can done,
- when not use coverage reporter , run karma.config -- reporter progress, not working
- changing
it fit
in unit test.
how debug single karma test using webstorm?
karma.config
module.exports = function(config) { var testwebpackconfig = require('./webpack.test.js')({env: 'test'}); var configuration = { htmlreporter: { outputfile: 'tests/reports/units.html', // optional pagetitle: 'unit tests', subpagetitle: 'a sample project description', groupsuites: true, usecompactstyle: true, uselegacystyle: true }, // base path used resolve patterns (e.g. files, exclude) basepath: '', /* * frameworks use * * available frameworks: https://npmjs.org/browse/keyword/karma-adapter */ frameworks: ['jasmine'], // list of files exclude exclude: [ ], /* * list of files / patterns load in browser * * building test environment in ./spec-bundle.js */ files: [ { pattern: './config/spec-bundle.js', watched: false } ], /* * preprocess matching files before serving them browser * available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor */ preprocessors: { './config/spec-bundle.js': ['coverage', 'webpack', 'sourcemap'] }, // webpack config @ ./webpack.test.js webpack: testwebpackconfig, // coveragereporter: { // type: 'in-memory' // }, remapcoveragereporter: { 'text-summary': null, json: './coverage/coverage.json', html: './coverage/html' }, // webpack please don't spam console when running in karma! webpackmiddleware: { stats: 'errors-only'}, /* * test results reporter use * * possible values: 'dots', 'progress' * available reporters: https://npmjs.org/browse/keyword/karma-reporter */ // change !!! reporters: [ 'progress' ], //reporters: [ 'mocha', 'coverage', 'remap-coverage', 'progress', 'html' ], // web server port port: 9876, // enable / disable colors in output (reporters , 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 , executing tests whenever file changes autowatch: true, /* * start these browsers * available browser launchers: https://npmjs.org/browse/keyword/karma-launcher */ browsers: [ 'chrome' ], customlaunchers: { chrometravisci: { base: 'chrome', flags: ['--no-sandbox'] } }, /* * continuous integration mode * if true, karma captures browsers, runs tests , exits */ singlerun: process.env.travis ? true : false }; if (process.env.travis){ configuration.browsers = ['phantomjs']; } config.set(configuration); };
'focused' specs/suits work me (webstorm 2016.3 eap) - fdescribe
/fit
suits/tests results shown in test runner console.
if miss possibility run individual karma tests/suits, please follow web-13173 updates. see https://github.com/karma-runner/karma/issues/1235
Comments
Post a Comment