File tree Expand file tree Collapse file tree 2 files changed +16
-16
lines changed
Expand file tree Collapse file tree 2 files changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,21 @@ export class ConsoleCatcher {
7979 } ) ;
8080 }
8181
82+ /**
83+ * Handles error events by converting them to console log events
84+ */
85+ public addErrorEvent ( event : ErrorEvent | PromiseRejectionEvent ) : void {
86+ const logEvent = this . createConsoleEventFromError ( event ) ;
87+ this . addToConsoleOutput ( logEvent ) ;
88+ }
89+
90+ /**
91+ * Returns the current console output buffer
92+ */
93+ public getConsoleLogStack ( ) : ConsoleLogEvent [ ] {
94+ return [ ...this . consoleOutput ] ;
95+ }
96+
8297 /**
8398 * Converts any argument to its string representation
8499 */
@@ -178,19 +193,4 @@ export class ConsoleCatcher {
178193 fileLine : '' ,
179194 } ;
180195 }
181-
182- /**
183- * Handles error events by converting them to console log events
184- */
185- public addErrorEvent ( event : ErrorEvent | PromiseRejectionEvent ) : void {
186- const logEvent = this . createConsoleEventFromError ( event ) ;
187- this . addToConsoleOutput ( logEvent ) ;
188- }
189-
190- /**
191- * Returns the current console output buffer
192- */
193- public getConsoleLogStack ( ) : ConsoleLogEvent [ ] {
194- return [ ...this . consoleOutput ] ;
195- }
196196}
Original file line number Diff line number Diff line change @@ -539,7 +539,7 @@ export default class Catcher {
539539 }
540540
541541 if ( consoleLogs && consoleLogs . length > 0 ) {
542- ( addons as any ) . consoleOutput = consoleLogs ;
542+ addons . consoleOutput = consoleLogs ;
543543 }
544544
545545 return addons ;
You can’t perform that action at this time.
0 commit comments