angular - Firefox/Chrome 在 2000 毫秒内没有被杀死,发送 SIGKILL
问题描述
在我的本地 angular(v10) 项目中运行ng test后,所有测试用例都成功执行,浏览器也正在启动,我可以看到绿点,但最后一刻浏览器被杀死,并在我的以下警告命令提示符
业力.config.js
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
'karma-jasmine',
'karma-firefox-launcher',
'karma-jasmine-html-reporter',
'karma-coverage-istanbul-reporter',
'@angular-devkit/build-angular/plugins/karma',
'karma-junit-reporter',
'karma-sonarqube-unit-reporter'
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, './coverage'),
reports: [ 'html', 'lcovonly', 'text-summary' ],
fixWebpackSourcePaths: true
},
sonarQubeUnitReporter: {
sonarQubeVersion: 'LATEST',
outputFile: 'reports/ut_report.xml',
overrideTestDescription: true,
testPaths: ['./ng-app'],
testFilePattern: '.spec.ts',
useBrowserName: false
},
junitReporter: {
outputDir: 'angular_junit_reporter', // results will be saved as $outputDir/$browserName.xml
outputFile: 'karma_unit_test', // if included, results will be saved as $outputDir/$browserName/$outputFile
suite: '', // suite will become the package name attribute in xml testsuite element
useBrowserName: true, // add browser name to report and classes names
nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element
classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element
properties: {}, // key value pair of properties to add to the <properties> section of the report
xmlVersion: null // use '1' if reporting to be per SonarQube 6.2 XML format
},
angularCli: {
environment: 'dev',
codeCoverage: true
},
reporters: config.angularCli && config.angularCli.codeCoverage
? ['progress', 'coverage-istanbul']
: ['progress', 'kjhtml', 'sonarqubeUnit', 'junit'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: false,
browsers: ['Firefox'],
singleRun: true,
restartOnFileChange: false,
captureTimeout: 210000,
browserDisconnectTolerance: 3,
browserDisconnectTimeout : 210000,
browserNoActivityTimeout : 210000
});
};
这里有什么问题?
解决方案
将您的值更改为:- autoWatch:true,singleRun:false,
可选更改,可能需要也可能不需要 restartOnFileChange: true
删除冒号前的空格:- browserDisconnectTimeout: 210000, browserNoActivityTimeout: 210000
推荐阅读
- firebase - Firebase 存储:检查用户是否为管理员
- python - 如何使用 python 的 any() 或 next() 函数检查构造以查看元素是否存在
- unity3d - 无法构建 Unity 并将 UWP 运行到 Xbox One VS2019。构建工具的问题
- javascript - 如何将 JSON 数据导入 Javascript 表?
- javascript - 在滚动时触发圆环图动画
- javascript - 重置 html 视频以开始
- java - 如何打印出字符串的随机字符?
- angular - TS2693 'string' 仅指一种类型,但在此处用作值
- python - Discord.py 如何从 discord.py 将 str 转换为特定类型
- python - tracemalloc 未检测到 python 中的内存泄漏