@@ -247,8 +247,23 @@ function requestBlocker() {
247
247
}
248
248
249
249
// Strip the server address and webpack scheme (webpack://) from error log.
250
- const initSourcemapReporter : any = function ( this : any , baseReporterDecorator : any ) {
250
+ const initSourcemapReporter : any = function ( this : any , baseReporterDecorator : any , config : any ) {
251
251
baseReporterDecorator ( this ) ;
252
+
253
+ const reporterName = '@angular/cli' ;
254
+ const hasTrailingReporters = config . reporters . slice ( - 1 ) . pop ( ) !== reporterName ;
255
+
256
+ // Copied from "karma-jasmine-diff-reporter" source code:
257
+ // In case, when multiple reporters are used in conjunction
258
+ // with initSourcemapReporter, they both will show repetitive log
259
+ // messages when displaying everything that supposed to write to terminal.
260
+ // So just suppress any logs from initSourcemapReporter by doing nothing on
261
+ // browser log, because it is an utility reporter,
262
+ // unless it's alone in the "reporters" option and base reporter is used.
263
+ if ( hasTrailingReporters ) {
264
+ this . writeCommonMsg = function ( ) { } ;
265
+ }
266
+
252
267
const urlRegexp = / \( h t t p : \/ \/ l o c a l h o s t : \d + \/ _ k a r m a _ w e b p a c k _ \/ w e b p a c k : \/ / gi;
253
268
254
269
this . onSpecComplete = function ( _browser : any , result : any ) {
@@ -260,7 +275,7 @@ const initSourcemapReporter: any = function (this: any, baseReporterDecorator: a
260
275
} ;
261
276
} ;
262
277
263
- initSourcemapReporter . $inject = [ 'baseReporterDecorator' ] ;
278
+ initSourcemapReporter . $inject = [ 'baseReporterDecorator' , 'config' ] ;
264
279
265
280
module . exports = Object . assign ( {
266
281
'framework:@angular/cli' : [ 'factory' , init ] ,
0 commit comments