gulp karma test TypeError: Server is not a function
gulp karma test TypeError: Server is not a function
尝试使用 gulp 运行 karma 进行 运行ning 测试,但在遵循以下示例之后:https://github.com/karma-runner/gulp-karma
我的 gulp 文件:
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();
});
/**
* Watch for file changes and re-run tests on each change
*/
gulp.task('tdd', function (done) {
new Server({
configFile: __dirname + '/karma.conf.js'
}, done).start();
});
gulp.task('default', ['tdd']);
在我 运行: gulp 测试后我得到错误:
TypeError: Server is not a function at Gulp.<anonymous>
有什么可能出错的建议吗?
尝试使用 gulp 运行 karma 进行 运行ning 测试,但在遵循以下示例之后:https://github.com/karma-runner/gulp-karma
我的 gulp 文件:
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();
});
/**
* Watch for file changes and re-run tests on each change
*/
gulp.task('tdd', function (done) {
new Server({
configFile: __dirname + '/karma.conf.js'
}, done).start();
});
gulp.task('default', ['tdd']);
在我 运行: gulp 测试后我得到错误:
TypeError: Server is not a function at Gulp.<anonymous>
有什么可能出错的建议吗?