尽管存在 'single' 参数,但 Karma 测试过程不会自动终止
Karma tests process is not autoterminating despite of a 'single' argument
我正在 VSTS 上创建构建定义,我需要结束任务才能开始下一个任务。
当我执行
npm run test:single
测试执行但随后进程不会自动终止,如果我按 ctrl + c
我会收到询问 Terminate batch job (y/n)
即使我点击 y
然后在下一个 ctrl + c
我明白了
C:\GIT\data>[0] 12 06 2017 11:17:26.232:DEBUG [launcher]: Disconnecting all browsers
在pacakges.json
测试单定义为:
"test:single": "npm run tsc && concurrently \"npm run karma-jasmine:autoclose\""
Karma 的版本是:
"@types/jasmine": "2.5.47"
问题:当 karma 完成我的测试时,如何使测试进程终止。
package.json的一部分:
"scripts": {
"ci": "npm run lint && npm run format && npm run test:single && npm run test-node",
"format": "gulp format:enforce",
"karma-jasmine": "karma start karma-build-jasmine.conf.js",
"karma-jasmine:single": "karma start karma-build-jasmine.conf.js --single-run",
"karma-jasmine:autoclose": "npm run karma-jasmine:single",
"lint": "gulp lint",
"prepublish": "tsc && gulp build",
"tsc": "tsc",
"tsc:w": "tsc -w",
"test": "npm run tsc && concurrently \"npm run tsc:w\" \"npm run karma-jasmine\"",
"test:single": "npm run tsc && concurrently \"npm run karma-jasmine:autoclose\"",
"test-dist": "concurrently \"npm run tsc:w\" \"karma start karma-dist-jasmine.conf.js\"",
"test-node": "gulp test/node"
},
"repository": {
"type": "git",
"url": "git://github.com/xxx"
},
"bugs": {
"url": "https://github.com/xxx"
},
"dependencies": {},
"devDependencies": {
"@types/jasmine": "2.5.47",
"@types/node": "^7.0.18",
"@types/systemjs": "^0.20.2",
"clang-format": "1.0.51",
"concurrently": "^3.4.0",
"es6-promise": "^4.1.0",
"gulp": "^3.8.11",
"gulp-clang-format": "^1.0.23",
"gulp-rename": "^1.2.2",
"gulp-rollup": "^2.3.0",
"gulp-tsc": "^1.1.4",
"gulp-tslint": "^8.0.0",
"gulp-uglify": "^2.1.2",
"gulp-util": "^3.0.7",
"jasmine": "^2.4.1",
"jasmine-core": "^2.2.0",
"karma": "^1.7.0",
"karma-chrome-launcher": "^2.1.1",
"karma-firefox-launcher": "^1.0.1",
"karma-jasmine": "^1.1.0",
"karma-mocha": "^1.2.0",
"karma-safari-launcher": "^1.0.0",
"karma-sourcemap-loader": "^0.3.6",
"karma-spec-reporter-2": "^0.2.0",
"mocha": "^3.1.2",
"pump": "^1.0.1",
"rewire": "^2.5.2",
"systemjs": "^0.20.12",
"ts-loader": "^2.0.3",
"tslint": "^5.2.0",
"tslint-eslint-rules": "^4.0.0",
"typescript": "2.3.2",
"vrsource-tslint-rules": "^5.1.0",
"whatwg-fetch": "^2.0.1"
}
}
我需要删除 spec
报告器,因为它在打印输出后没有自行终止。
我正在 VSTS 上创建构建定义,我需要结束任务才能开始下一个任务。
当我执行
npm run test:single
测试执行但随后进程不会自动终止,如果我按 ctrl + c
我会收到询问 Terminate batch job (y/n)
即使我点击 y
然后在下一个 ctrl + c
我明白了
C:\GIT\data>[0] 12 06 2017 11:17:26.232:DEBUG [launcher]: Disconnecting all browsers
在pacakges.json
测试单定义为:
"test:single": "npm run tsc && concurrently \"npm run karma-jasmine:autoclose\""
Karma 的版本是:
"@types/jasmine": "2.5.47"
问题:当 karma 完成我的测试时,如何使测试进程终止。
package.json的一部分:
"scripts": {
"ci": "npm run lint && npm run format && npm run test:single && npm run test-node",
"format": "gulp format:enforce",
"karma-jasmine": "karma start karma-build-jasmine.conf.js",
"karma-jasmine:single": "karma start karma-build-jasmine.conf.js --single-run",
"karma-jasmine:autoclose": "npm run karma-jasmine:single",
"lint": "gulp lint",
"prepublish": "tsc && gulp build",
"tsc": "tsc",
"tsc:w": "tsc -w",
"test": "npm run tsc && concurrently \"npm run tsc:w\" \"npm run karma-jasmine\"",
"test:single": "npm run tsc && concurrently \"npm run karma-jasmine:autoclose\"",
"test-dist": "concurrently \"npm run tsc:w\" \"karma start karma-dist-jasmine.conf.js\"",
"test-node": "gulp test/node"
},
"repository": {
"type": "git",
"url": "git://github.com/xxx"
},
"bugs": {
"url": "https://github.com/xxx"
},
"dependencies": {},
"devDependencies": {
"@types/jasmine": "2.5.47",
"@types/node": "^7.0.18",
"@types/systemjs": "^0.20.2",
"clang-format": "1.0.51",
"concurrently": "^3.4.0",
"es6-promise": "^4.1.0",
"gulp": "^3.8.11",
"gulp-clang-format": "^1.0.23",
"gulp-rename": "^1.2.2",
"gulp-rollup": "^2.3.0",
"gulp-tsc": "^1.1.4",
"gulp-tslint": "^8.0.0",
"gulp-uglify": "^2.1.2",
"gulp-util": "^3.0.7",
"jasmine": "^2.4.1",
"jasmine-core": "^2.2.0",
"karma": "^1.7.0",
"karma-chrome-launcher": "^2.1.1",
"karma-firefox-launcher": "^1.0.1",
"karma-jasmine": "^1.1.0",
"karma-mocha": "^1.2.0",
"karma-safari-launcher": "^1.0.0",
"karma-sourcemap-loader": "^0.3.6",
"karma-spec-reporter-2": "^0.2.0",
"mocha": "^3.1.2",
"pump": "^1.0.1",
"rewire": "^2.5.2",
"systemjs": "^0.20.12",
"ts-loader": "^2.0.3",
"tslint": "^5.2.0",
"tslint-eslint-rules": "^4.0.0",
"typescript": "2.3.2",
"vrsource-tslint-rules": "^5.1.0",
"whatwg-fetch": "^2.0.1"
}
}
我需要删除 spec
报告器,因为它在打印输出后没有自行终止。