@@ -72,19 +72,14 @@ describe("classifyPageError", () => {
7272
7373 it ( "records a syntax error and a thrown string, which carry no error stack" , ( ) => {
7474 const syntax = thrown ( "SyntaxError: Unexpected token ';'" , `${ server } /comp.js` , [ ] ) ;
75- const plain = thrown (
76- undefined ,
77- `${ server } /index.html` ,
78- [ `${ server } /index.html` ] ,
79- "plain string" ,
80- ) ;
75+ const plain = thrown ( undefined , doc , [ doc ] , "plain string" ) ;
8176 expect ( classifyPageError ( syntax , doc ) ) . toBe ( "runtime-error:SyntaxError: Unexpected token ';'" ) ;
8277 expect ( classifyPageError ( plain , doc ) ) . toBe ( "runtime-error:plain string" ) ;
8378 } ) ;
8479
8580 it ( "records a foreign library throwing when the composition called it" , ( ) => {
8681 const lib = "https://cdn.example/lib.js" ;
87- expect ( classifyPageError ( thrown ( "TypeError: x" , lib , [ lib , ` ${ server } /index.html` ] ) , doc ) ) . toBe (
82+ expect ( classifyPageError ( thrown ( "TypeError: x" , lib , [ lib , doc ] ) , doc ) ) . toBe (
8883 "runtime-error:TypeError: x" ,
8984 ) ;
9085 } ) ;
@@ -100,9 +95,7 @@ describe("classifyPageError", () => {
10095 const abort =
10196 "AbortError: The play() request was interrupted by a call to pause(). https://goo.gl/LdLk22" ;
10297 expect ( classifyPageError ( thrown ( "Error: widget failed" , widget , [ widget ] ) , doc ) ) . toBeNull ( ) ;
103- expect (
104- classifyPageError ( thrown ( abort , `${ server } /index.html` , [ `${ server } /index.html` ] ) , doc ) ,
105- ) . toBeNull ( ) ;
98+ expect ( classifyPageError ( thrown ( abort , doc , [ doc ] ) , doc ) ) . toBeNull ( ) ;
10699 } ) ;
107100
108101 // initializeSession registers its listeners before the incomplete fake session makes it throw.
@@ -123,9 +116,7 @@ describe("classifyPageError", () => {
123116 browserConsoleBuffer : [ ] ,
124117 } ;
125118 await initializeSession ( session as unknown as CaptureSession ) . catch ( ( ) => { } ) ;
126- const error = thrown ( "ReferenceError: gsap is not defined" , `${ server } /index.html` , [
127- `${ server } /index.html` ,
128- ] ) ;
119+ const error = thrown ( "ReferenceError: gsap is not defined" , doc , [ doc ] ) ;
129120 runtimeListeners . get ( "Runtime.exceptionThrown" ) ?.( { exceptionDetails : error } ) ;
130121 runtimeListeners . get ( "Runtime.exceptionThrown" ) ?.( { exceptionDetails : error } ) ;
131122 expect ( session . pageErrors ) . toEqual ( [ "runtime-error:ReferenceError: gsap is not defined" ] ) ;
0 commit comments