运行gulp任务来测试karma在我的本地机器上使用visual工作正常 studio Task Runner Explorer或使用命令提示符,但如果在期间失败 持续整合。
这是gulp中的任务。
gulp.task('run-test', function (done) {
Server.start({
configFile: __dirname + '/karma.conf.js',
singleRun: true
}, function (result) {
if (result > 0) {
return done(new Error(`Karma exited with status code ${result}`));
}
done();
});
});
以下是我得到的错误。
Starting: gulp run-test
****************************************************************************
C:\Users\issblder\AppData\Roaming\npm\gulp.cmd run-test --gulpfile
C:\BA\263\s\x.y\x.y.Web\gulpfile.js
Using gulpfile C:\BA\263\s\x.y\x.y.Web\gulpfile.js
Starting 'run-test'...
[33m05 04 2017 10:28:07.848:WARN [proxy]: [39mproxy "/base/Scripts/src/app" normalized to "/base/Scripts/src/app/"
[33m05 04 2017 10:28:09.051:WARN [watcher]: [39mPattern "C:/BA/263/s/x.y/x.y.Web/Scripts/src/app/**/*.css" does not match any file.
[32m05 04 2017 10:28:10.707:INFO [karma]: [39mKarma v1.5.0 server started at http://0.0.0.0:9876/
[32m05 04 2017 10:28:10.707:INFO [launcher]: [39mLaunching browser PhantomJS with unlimited concurrency
[32m05 04 2017 10:28:10.738:INFO [launcher]: [39mStarting browser PhantomJS
[32m05 04 2017 10:28:14.399:INFO [PhantomJS 2.1.1 (Windows 8 0.0.0)]:
[39mConnected on socket llGPa-KBXnovTYHkAAAA with id 95283473
[33m05 04 2017 10:28:14.500:WARN [web-server]: [39m404: /base/node_modules/systemjs/dist/system-polyfills.js
PhantomJS 2.1.1 (Windows 8 0.0.0): Executed 0 of 0 SUCCESS (0 secs / 0 secs)
[1A[2KPhantomJS 2.1.1 (Windows 8 0.0.0): Executed 0 of 0 ERROR (0 secs / 0 secs)
'run-test' errored after 7.41 s
Error: Karma exited with status code 1
at C:\BA\263\s\x.y\x.y.Web\gulpfile.js:33:25
at removeAllListeners (C:\BA\263\s\x.y\x.y.Web\node_modules\karma\lib\server.js:380:7)
at Server.<anonymous> (C:\BA\263\s\x.y\x.y.Web\node_modules\karma\lib\server.js:391:9)
at Server.g (events.js:260:16)
at emitNone (events.js:72:20)
at Server.emit (events.js:166:7)
at emitCloseNT (net.js:1521:8)
at nextTickCallbackWith1Arg (node.js:431:9)
at process._tickCallback (node.js:353:17)
Gulp failed with error: C:\Users\issblder\AppData\Roaming\npm\gulp.cmd failed with return code: 1
****************************************************************************
Finishing: gulp run-test.
我正在使用这些开发依赖项
"devDependencies": {
"@types/jasmine": "^2.5.46",
"concurrently": "^3.1.0",
"del": "^2.2.0",
"gulp": "^3.8.8",
"gulp-babel": "^6.1.2",
"gulp-concat": "^2.6.1",
"gulp-delete-lines": "^0.0.7",
"gulp-inject-string": "^1.1.0",
"gulp-ngc": "^0.1.2",
"gulp-size": "^2.1.0",
"gulp-sourcemaps": "^1.9.1",
"gulp-tslint": "^7.0.1",
"gulp-typescript": "^3.1.3",
"gulp-uglify": "^2.0.0",
"gulp-util": "^3.0.8",
"jasmine-core": "^2.5.2",
"karma": "^1.5.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.1.0",
"karma-junit-reporter": "^1.2.0",
"karma-phantomjs-launcher": "^1.0.4",
"karma-xml-reporter": "^0.1.4",
"lite-server": "^2.2.2",
"phantomjs": "^2.1.7",
"rollup": "^0.41.4",
"rollup-plugin-commonjs": "^7.0.0",
"rollup-plugin-node-resolve": "^2.0.0",
"rollup-plugin-uglify": "^1.0.1",
"rollup-stream": "^1.19.0",
"run-sequence": "^1.2.2",
"ts-node": "^1.7.2",
"tslint": "^4.0.2",
"typescript": "^2.1.4",
"typings": "^2.0.0",
"vinyl-source-stream": "^1.1.0"
},