在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):karma-runner/gulp-karma开源软件地址(OpenSource Url):https://github.com/karma-runner/gulp-karma开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):gulp-karmatl;dr;You don't need any gulp plugins (why?) to run Karma from the Gulp-based build, use Karma directly: var gulp = require('gulp');
var Server = require('karma').Server;
/**
* Run test once and exit
*/
gulp.task('test', function (done) {
new Server({
configFile: __dirname + '/karma.conf.js',
singleRun: true
}, done).start();
}); Illustrated tasksThis sample project illustrates 2 usage scenarios of Karma integration in the Gulp.js build:
Do we need a plugin?While there exist integration of the karma-runner into Grunt based builds (https://github.com/karma-runner/grunt-karma) we've decided not to create a dedicated plugin for Gulp.js. The reasoning here is that it is very, very easy to invoke Karma's public API directly from a Gulp.js task, as illustrated in this repository. Writing a dedicated plugin would bring little benefit and could limit possible usage scenarios. To see how easy is to integrate Karma into an existing Gulp.js build just check the included gulpfile.js. There are several people moving from Grunt.js to Gulp.js who noticed that with Gulp we often don't need a dedicated plugin anymore. For example, a good overview of such situation can be found in the following article. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论