@@ -5,15 +5,15 @@ import { sentryTest } from '../../../utils/fixtures';
5
5
import { getFirstSentryEnvelopeRequest } from '../../../utils/helpers' ;
6
6
7
7
sentryTest (
8
- 'should add source context lines around stack frames from errors in Html' ,
8
+ 'should add source context lines around stack frames from errors in Html inline JS ' ,
9
9
async ( { getLocalTestPath, page } ) => {
10
10
const url = await getLocalTestPath ( { testDir : __dirname } ) ;
11
11
12
12
const eventPromise = getFirstSentryEnvelopeRequest < Event > ( page , url ) ;
13
13
14
- await page . click ( '#inline-error-btn' ) ;
14
+ const clickPromise = page . click ( '#inline-error-btn' ) ;
15
15
16
- const eventData = await eventPromise ;
16
+ const [ eventData ] = await Promise . all ( [ eventPromise , clickPromise ] ) ;
17
17
18
18
expect ( eventData . exception ?. values ) . toHaveLength ( 1 ) ;
19
19
@@ -23,14 +23,12 @@ sentryTest(
23
23
stacktrace : {
24
24
frames : [
25
25
{
26
- colno : 97 ,
27
- lineno : 7 ,
28
26
pre_context : [ ' <meta charset="utf-8">' , ' </head>' , ' <body>' ] ,
29
27
context_line :
30
28
' <button id="inline-error-btn" onclick="throw new Error(\'Error with context lines\')">Click me</button>' ,
31
29
post_context : [
32
30
' <button id="script-error-btn">Click me too</button>' ,
33
- ' <script defer="" src="init .bundle.js"></script><script defer="" src="subject.bundle.js"></script>' ,
31
+ expect . stringContaining ( 'subject .bundle.js' ) , // this line varies in the test based on tarball/cdn bundle (+variants)
34
32
' <footer>' ,
35
33
] ,
36
34
} ,
@@ -40,7 +38,7 @@ sentryTest(
40
38
} ,
41
39
) ;
42
40
43
- sentryTest ( 'should not add source context lines to errors from scripts ' , async ( { getLocalTestPath, page } ) => {
41
+ sentryTest ( 'should not add source context lines to errors from script files ' , async ( { getLocalTestPath, page } ) => {
44
42
const url = await getLocalTestPath ( { testDir : __dirname } ) ;
45
43
46
44
const eventPromise = getFirstSentryEnvelopeRequest < Event > ( page , url ) ;
0 commit comments