@@ -34,25 +34,34 @@ test.skip("build + start", async ({ page, edit, $ }) => {
34
34
await edit ( "netlify.toml" , ( txt ) =>
35
35
txt
36
36
. replaceAll ( "[dev]" , "[dev]\nautoLaunch = false" )
37
- . replaceAll ( "npm run" , "pnpm" )
37
+ . replaceAll ( "npm run" , "pnpm" ) ,
38
38
) ;
39
39
40
40
const port1 = await getPort ( ) ;
41
41
const port2 = await getPort ( ) ;
42
42
const port3 = await getPort ( ) ;
43
43
const start = $ (
44
- `pnpm start --port ${ port1 } --functionsPort ${ port2 } --staticServerPort ${ port3 } `
44
+ `pnpm start --port ${ port1 } --functionsPort ${ port2 } --staticServerPort ${ port3 } ` ,
45
45
) ;
46
46
47
47
const url = await matchLine ( start . stdout , urlRegex . netlify ) ;
48
48
await workflow ( { page, url } ) ;
49
49
expect ( start . buffer . stderr ) . toBe ( "" ) ;
50
50
} ) ;
51
51
52
+ // Helper function to filter out expected WebSocket errors
53
+ function filterExpectedErrors ( errors : Error [ ] ) {
54
+ return errors . filter (
55
+ ( error ) =>
56
+ ! error . message . includes ( "WebSocket closed without opened" ) &&
57
+ ! error . message . includes ( "WebSocket server error" ) ,
58
+ ) ;
59
+ }
60
+
52
61
async function workflow ( { page, url } : { page : Page ; url : string } ) {
53
62
await page . goto ( url ) ;
54
63
await expect ( page ) . toHaveTitle ( / N e w R e a c t R o u t e r A p p / ) ;
55
64
await page . getByRole ( "link" , { name : "React Router Docs" } ) . waitFor ( ) ;
56
65
await page . getByRole ( "link" , { name : "Join Discord" } ) . waitFor ( ) ;
57
- expect ( page . errors ) . toStrictEqual ( [ ] ) ;
66
+ expect ( filterExpectedErrors ( page . errors ) ) . toStrictEqual ( [ ] ) ;
58
67
}
0 commit comments