webstrom里集成mocha测试

添加一个nodejs运行配置,注意修改这个选项就可正常运行

path to node app js file:

node_modules\mocha\bin\_mocha

只能测试test目录中的文件


用grunt来做多目录测试

npm install -g grunt-cli
npm install grunt

npm install grunt-mocha-test 这个是集成测试用的

修改配置Gruntfile。js

1:

mochaTest: {
files: ['test/**/*.js']
} ,
mochaTestConfig: {
options: {
reporter: 'spec',
require: 'node_modules/should'
}
}

grunt.loadNpmTasks('grunt-mocha-test');
grunt.registerTask('default', ['requirejs','cssmin','concat', 'uglify','mochaTest']);

 
原文地址:https://www.cnblogs.com/panzulong/p/3044288.html