我正在运行一个Angular应用程序并且我的单元测试工作正常,但每次运行测试时都会收到所有这些警告:
HeadlessChrome 0.0.0 (Mac OS X 10.12.6) LOG: '>>>>>>', '', 'Error: STACKTRACE TRACKING'
HeadlessChrome 0.0.0 (Mac OS X 10.12.6) LOG: '>>>>>>', '', 'Error: STACKTRACE TRACKING'
HeadlessChrome 0.0.0 (Mac OS X 10.12.6) LOG: '>>>>>>', '', 'Error: STACKTRACE TRACKING'
HeadlessChrome 0.0.0 (Mac OS X 10.12.6) LOG: '>>>>>>', ' at __SEP_TAG__ (http://localhost:9876/_karma_webpack_/webpack:/Users/vassilis/Projects/Client-Portal-FE/node_modules/zone.js/dist/zone.js:993:1)', ' at ZoneAwareError (http://localhost:9876/_karma_webpack_/webpack:/Users/vassilis/Projects/Client-Portal-FE/node_modules/zone.js/dist/zone.js:993:1)'
HeadlessChrome 0.0.0 (Mac OS X 10.12.6) LOG: '>>>>>>', ' at __SEP_TAG__ (http://localhost:9876/_karma_webpack_/webpack:/Users/vassilis/Projects/Client-Portal-FE/node_modules/zone.js/dist/zone.js:993:1)', ' at ZoneAwareError (http://localhost:9876/_karma_webpack_/webpack:/Users/vassilis/Projects/Client-Portal-FE/node_modules/zone.js/dist/zone.js:993:1)'
HeadlessChrome 0.0.0 (Mac OS X 10.12.6) LOG: '>>>>>>', ' at __SEP_TAG__ (http://localhost:9876/_karma_webpack_/webpack:/Users/vassilis/Projects/Client-Portal-FE/node_modules/zone.js/dist/zone.js:993:1)', ' at ZoneAwareError (http://localhost:9876/_karma_webpack_/webpack:/Users/vassilis/Projects/Client-Portal-FE/node_modules/zone.js/dist/zone.js:993:1)'
HeadlessChrome 0.0.0 (Mac OS X 10.12.6) LOG: '>>>>>>', ' at __SEP_TAG__ (http://localhost:9876/_karma_webpack_/webpack:/Users/vassilis/Projects/Client-Portal-FE/node_modules/zone.js/dist/zone.js:993:1)', ' at getStacktraceWithUncaughtError (http://localhost:9876/_karma_webpack_/webpack:/Users/vassilis/Projects/Client-Portal-FE/node_modules/zone.js/dist/long-stack-trace-zone.js:39:1)'
HeadlessChrome 0.0.0 (Mac OS X 10.12.6) LOG: '>>>>>>', ' at __SEP_TAG__ (http://localhost:9876/_karma_webpack_/webpack:/Users/vassilis/Projects/Client-Portal-FE/node_modules/zone.js/dist/zone.js:993:1)', ' at getStacktraceWithUncaughtError (http://localhost:9876/_karma_webpack_/webpack:/Users/vassilis/Projects/Client-Portal-FE/node_modules/zone.js/dist/long-stack-trace-zone.js:39:1)'
HeadlessChrome 0.0.0 (Mac OS X 10.12.6) LOG: '>>>>>>', ' at __SEP_TAG__ (http://localhost:9876/_karma_webpack_/webpack:/Users/vassilis/Projects/Client-Portal-FE/node_modules/zone.js/dist/zone.js:993:1)', ' at getStacktraceWithUncaughtError (http://localhost:9876/_karma_webpack_/webpack:/Users/vassilis/Projects/Client-Portal-FE/node_modules/zone.js/dist/long-stack-trace-zone.js:39:1)'
HeadlessChrome 0.0.0 (Mac OS X 10.12.6) LOG: '>>>>>>', ' at __SEP_TAG__ (http://localhost:9876/_karma_webpack_/webpack:/Users/vassilis/Projects/Client-Portal-FE/node_modules/zone.js/dist/zone.js:993:1)', ' at new LongStackTrace (http://localhost:9876/_karma_webpack_/webpack:/Users/vassilis/Projects/Client-Portal-FE/node_modules/zone.js/dist/long-stack-trace-zone.js:33:1)'
HeadlessChrome 0.0.0 (Mac OS X 10.12.6) LOG: '>>>>>>', ' at __SEP_TAG__ (http://localhost:9876/_karma_webpack_/webpack:/Users/vassilis/Projects/Client-Portal-FE/node_modules/zone.js/dist/zone.js:993:1)', ' at new LongStackTrace (http://localhost:9876/_karma_webpack_/webpack:/Users/vassilis/Projects/Client-Portal-FE/node_modules/zone.js/dist/long-stack-trace-zone.js:33:1)'
HeadlessChrome 0.0.0 (Mac OS X 10.12.6) LOG: '>>>>>>', ' at __SEP_TAG__ (http://localhost:9876/_karma_webpack_/webpack:/Users/vassilis/Projects/Client-Portal-FE/node_modules/zone.js/dist/zone.js:993:1)', ' at new LongStackTrace (http://localhost:9876/_karma_webpack_/webpack:/Users/vassilis/Projects/Client-Portal-FE/node_modules/zone.js/dist/long-stack-trace-zone.js:33:1)'
HeadlessChrome 0.0.0 (Mac OS X 10.12.6) LOG: '>>>>>>', ' at __SEP_TAG__ (http://localhost:9876/_karma_webpack_/webpack:/Users/vassilis/Projects/Client-Portal-FE/node_modules/zone.js/dist/zone.js:993:1)', ' at captureStackTraces (http://localhost:9876/_karma_webpack_/webpack:/Users/vassilis/Projects/Client-Portal-FE/node_modules/zone.js/dist/long-stack-trace-zone.js:128:1)'
HeadlessChrome 0.0.0 (Mac OS X 10.12.6) LOG: '>>>>>>', ' at __SEP_TAG__ (http://localhost:9876/_karma_webpack_/webpack:/Users/vassilis/Projects/Client-Portal-FE/node_modules/zone.js/dist/zone.js:993:1)', ' at captureStackTraces (http://localhost:9876/_karma_webpack_/webpack:/Users/vassilis/Projects/Client-Portal-FE/node_modules/zone.js/dist/long-stack-trace-zone.js:128:1)'
HeadlessChrome 0.0.0 (Mac OS X 10.12.6) LOG: '>>>>>>', ' at __SEP_TAG__ (http://localhost:9876/_karma_webpack_/webpack:/Users/vassilis/Projects/Client-Portal-FE/node_modules/zone.js/dist/zone.js:993:1)', ' at captureStackTraces (http://localhost:9876/_karma_webpack_/webpack:/Users/vassilis/Projects/Client-Portal-FE/node_modules/zone.js/dist/long-stack-trace-zone.js:128:1)'
这里也是我的业力配置:
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular/cli/plugins/karma')
],
client:{
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
reports: [ 'html', 'lcovonly' ],
fixWebpackSourcePaths: true
},
angularCli: {
environment: 'dev'
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
browsers: ['ChromeHeadless'],
concurrency: Infinity,
files: [
{ pattern: 'node_modules/hammerjs/hammer.min.js', included: true, watched: false },
{ pattern: 'node_modules/hammerjs/hammer.min.js.map', included: false, watched: false },
{ pattern: 'node_modules/@angular/material/prebuilt-themes/indigo-pink.css', included: true, watched: true },
]
});
};
我真的很想从终端中删除这些日志消息。 有什么想法吗?
答案 0 :(得分:0)
当您进行业力测试时,您可能会尝试从long-stack-trace-zone.js
移除polyfill.ts
。
答案 1 :(得分:0)
对于将来的读者,请将其添加到您的业力配置中:
browserConsoleLogOptions: {
level: 'warn',
format: '%b %T: %m',
terminal: false
},