File tree Expand file tree Collapse file tree 1 file changed +17
-13
lines changed Expand file tree Collapse file tree 1 file changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -120,22 +120,26 @@ describe("stats", () => {
120
120
121
121
const { page, browser } = await runBrowser ( ) ;
122
122
123
- const consoleMessages = [ ] ;
123
+ try {
124
+ const consoleMessages = [ ] ;
124
125
125
- page . on ( "console" , ( message ) => {
126
- consoleMessages . push ( message ) ;
127
- } ) ;
126
+ page . on ( "console" , ( message ) => {
127
+ consoleMessages . push ( message ) ;
128
+ } ) ;
128
129
129
- await page . goto ( `http://localhost:${ port } /` , {
130
- waitUntil : "networkidle0" ,
131
- } ) ;
130
+ await page . goto ( `http://localhost:${ port } /` , {
131
+ waitUntil : "networkidle0" ,
132
+ } ) ;
132
133
133
- expect (
134
- consoleMessages . map ( ( message ) => message . text ( ) )
135
- ) . toMatchSnapshot ( ) ;
136
-
137
- await browser . close ( ) ;
138
- await server . stop ( ) ;
134
+ expect (
135
+ consoleMessages . map ( ( message ) => message . text ( ) )
136
+ ) . toMatchSnapshot ( ) ;
137
+ } catch ( error ) {
138
+ throw error ;
139
+ } finally {
140
+ await browser . close ( ) ;
141
+ await server . stop ( ) ;
142
+ }
139
143
} ) ;
140
144
} ) ;
141
145
} ) ;
You can’t perform that action at this time.
0 commit comments