我通过gulp运行业力测试案例如下:
gulp.task('unit-test-karma', function () { return gulp.src(filePaths.libraryPaths.concat(filePaths.codePathsVerbose.concat(filePaths.testPaths).concat(filePaths.htmlPaths).concat(filePaths.jadePaths))) //.pipe(plumber({ errorHandler: notify.onError(function(error) { console.log(error.message); return "Karma Error"; }) })) .pipe(karma({ configFile: './karma.conf.js', action: 'run', // watch singleRun: true, reporters: [ 'dots' ] })); });
当我以操作方式运行时run
,IE 11会抛出错误.
IE 11.0.0 (Windows 10 0.0.0) ERROR 'expect' was used when there was no current spec, this could be because an asynchronous test timed out at C:/BbCAT-WebDI/BbCAT-Web/BbCAT-Angular/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:938
但是如果运行与动作相同,watch
则所有测试用例在chrome,IE和firefox中成功执行.
看完一些帖子后,似乎有一些问题与$ http服务电话但无法找到问题所在的确切位置!