Skip to content
Lance Vo edited this page Oct 9, 2013 · 2 revisions

Test with Webstorm

Based on instruction here: http://blog.jetbrains.com/webstorm/2013/10/running-javascript-tests-with-karma-in-webstorm-7/

Install karma, jasmine-karma, karma-coverage

npm install -g karma
npm install jasmine-karma
npm install karma-coverage

modified karma.conf.js for test coverage and specs

// include js files
files: [
	    'js/*.js',
	    // 'js/*.js',
      'test/**/*Spec.js'
    ],


    // list of files to exclude
    exclude: [
      'js/delete*.js'
    ],


    // test results reporter to use
    // possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
    reporters: ['progress', 'coverage'],

	  preprocessors: {
	      // source files, that you wanna generate coverage for
	      // do not include tests or libraries
	      // (these files will be instrumented by Istanbul)
	      'js/*.js': ['coverage']
	  },
Clone this wiki locally