mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	e2e-tests: Fix pageerror parameter type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							35d20b04d1
						
					
				
				
					commit
					8396c14cdc
				
			@@ -672,25 +672,31 @@ export async function run_test_async(test_function: (page: Page) => Promise<void
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    let page_errored = false;
 | 
			
		||||
    page.on("pageerror", (error: Error) => {
 | 
			
		||||
    page.on("pageerror", (error: unknown) => {
 | 
			
		||||
        page_errored = true;
 | 
			
		||||
 | 
			
		||||
        const console_ready1 = console_ready;
 | 
			
		||||
        console_ready = (async () => {
 | 
			
		||||
            const frames = await Promise.all(
 | 
			
		||||
                ErrorStackParser.parse(error).map(async (frame) => {
 | 
			
		||||
                    try {
 | 
			
		||||
                        frame = await gps.getMappedLocation(frame);
 | 
			
		||||
                    } catch {
 | 
			
		||||
                        // Ignore source mapping errors
 | 
			
		||||
                    }
 | 
			
		||||
                    return `\n    at ${String(frame.functionName)} (${String(
 | 
			
		||||
                        frame.fileName,
 | 
			
		||||
                    )}:${String(frame.lineNumber)}:${String(frame.columnNumber)})`;
 | 
			
		||||
                }),
 | 
			
		||||
            );
 | 
			
		||||
            let message;
 | 
			
		||||
            if (error instanceof Error) {
 | 
			
		||||
                const frames = await Promise.all(
 | 
			
		||||
                    ErrorStackParser.parse(error).map(async (frame) => {
 | 
			
		||||
                        try {
 | 
			
		||||
                            frame = await gps.getMappedLocation(frame);
 | 
			
		||||
                        } catch {
 | 
			
		||||
                            // Ignore source mapping errors
 | 
			
		||||
                        }
 | 
			
		||||
                        return `\n    at ${String(frame.functionName)} (${String(
 | 
			
		||||
                            frame.fileName,
 | 
			
		||||
                        )}:${String(frame.lineNumber)}:${String(frame.columnNumber)})`;
 | 
			
		||||
                    }),
 | 
			
		||||
                );
 | 
			
		||||
                message = error.toString() + frames.join("");
 | 
			
		||||
            } else {
 | 
			
		||||
                message = String(error);
 | 
			
		||||
            }
 | 
			
		||||
            await console_ready1;
 | 
			
		||||
            console.error("Page error:", error.message + frames.join(""));
 | 
			
		||||
            console.error("Page error:", message);
 | 
			
		||||
        })();
 | 
			
		||||
 | 
			
		||||
        const console_ready2 = console_ready;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user