File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
dev-packages/e2e-tests/test-applications Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -4,17 +4,17 @@ import { waitForInitialPageload } from './utils';
4
4
5
5
test . describe ( 'client-side errors' , ( ) => {
6
6
test ( 'captures error thrown on click' , async ( { page } ) => {
7
- await page . goto ( '/client-error' ) ;
8
-
9
- await expect ( page . getByText ( 'Client error' ) ) . toBeVisible ( ) ;
7
+ await waitForInitialPageload ( page , { route : '/client-error' , debug : false } ) ;
10
8
11
9
const errorEventPromise = waitForError ( 'sveltekit-2' , errorEvent => {
12
10
return errorEvent ?. exception ?. values ?. [ 0 ] ?. value === 'Click Error' ;
13
11
} ) ;
14
12
15
- const clickPromise = page . getByText ( 'Throw error' ) . click ( ) ;
13
+ await page . getByText ( 'Throw error' ) . click ( ) ;
14
+
15
+ await expect ( errorEventPromise ) . resolves . toBeDefined ( ) ;
16
16
17
- const [ errorEvent , _ ] = await Promise . all ( [ errorEventPromise , clickPromise ] ) ;
17
+ const errorEvent = await errorEventPromise ;
18
18
19
19
const errorEventFrames = errorEvent . exception ?. values ?. [ 0 ] ?. stacktrace ?. frames ;
20
20
Original file line number Diff line number Diff line change @@ -4,17 +4,17 @@ import { waitForInitialPageload } from '../utils';
4
4
5
5
test . describe ( 'client-side errors' , ( ) => {
6
6
test ( 'captures error thrown on click' , async ( { page } ) => {
7
- await page . goto ( '/client-error' ) ;
8
-
9
- await expect ( page . getByText ( 'Client error' ) ) . toBeVisible ( ) ;
7
+ await waitForInitialPageload ( page , { route : '/client-error' , debug : false } ) ;
10
8
11
9
const errorEventPromise = waitForError ( 'sveltekit' , errorEvent => {
12
10
return errorEvent ?. exception ?. values ?. [ 0 ] ?. value === 'Click Error' ;
13
11
} ) ;
14
12
15
- const clickPromise = page . getByText ( 'Throw error' ) . click ( ) ;
13
+ await page . getByText ( 'Throw error' ) . click ( ) ;
14
+
15
+ await expect ( errorEventPromise ) . resolves . toBeDefined ( ) ;
16
16
17
- const [ errorEvent , _ ] = await Promise . all ( [ errorEventPromise , clickPromise ] ) ;
17
+ const errorEvent = await errorEventPromise ;
18
18
19
19
const errorEventFrames = errorEvent . exception ?. values ?. [ 0 ] ?. stacktrace ?. frames ;
20
20
You can’t perform that action at this time.
0 commit comments