@@ -879,36 +879,32 @@ describe.each([
879
879
}
880
880
} )
881
881
882
- // assertion is highly flakey in turbopack mode
883
- if ( ! process . env . TURBOPACK ) {
884
- it ( 'should recover after loader parse error in an imported file' , async ( ) => {
885
- let browser
886
- const aboutPage = join ( 'pages' , 'hmr' , 'about9.js' )
882
+ // assertion is highly flakey
883
+ it . skip ( 'should recover after loader parse error in an imported file' , async ( ) => {
884
+ let browser
885
+ const aboutPage = join ( 'pages' , 'hmr' , 'about9.js' )
887
886
888
- const aboutContent = await next . readFile ( aboutPage )
889
- try {
890
- browser = await webdriver ( next . appPort , basePath + '/hmr/about9' )
891
- await check (
892
- ( ) => getBrowserBodyText ( browser ) ,
893
- / T h i s i s t h e a b o u t p a g e /
894
- )
887
+ const aboutContent = await next . readFile ( aboutPage )
888
+ try {
889
+ browser = await webdriver ( next . appPort , basePath + '/hmr/about9' )
890
+ await check ( ( ) => getBrowserBodyText ( browser ) , / T h i s i s t h e a b o u t p a g e / )
895
891
896
- await next . patchFile (
897
- aboutPage ,
898
- aboutContent . replace (
899
- 'export default' ,
900
- 'import "../../components/parse-error.js"\nexport default'
901
- )
892
+ await next . patchFile (
893
+ aboutPage ,
894
+ aboutContent . replace (
895
+ 'export default' ,
896
+ 'import "../../components/parse-error.js"\nexport default'
902
897
)
898
+ )
903
899
904
- expect ( await hasRedbox ( browser ) ) . toBe ( true )
905
- expect ( await getRedboxHeader ( browser ) ) . toMatch ( 'Failed to compile' )
906
- let redboxSource = await getRedboxSource ( browser )
900
+ expect ( await hasRedbox ( browser ) ) . toBe ( true )
901
+ expect ( await getRedboxHeader ( browser ) ) . toMatch ( 'Failed to compile' )
902
+ let redboxSource = await getRedboxSource ( browser )
907
903
908
- redboxSource = redboxSource . replace ( `${ next . testDir } ` , '.' )
909
- if ( process . env . TURBOPACK ) {
910
- expect ( next . normalizeTestDirContent ( redboxSource ) )
911
- . toMatchInlineSnapshot ( `
904
+ redboxSource = redboxSource . replace ( `${ next . testDir } ` , '.' )
905
+ if ( process . env . TURBOPACK ) {
906
+ expect ( next . normalizeTestDirContent ( redboxSource ) )
907
+ . toMatchInlineSnapshot ( `
912
908
"./components/parse-error.js:3:1
913
909
Parsing ecmascript source code failed
914
910
1 | This
@@ -920,14 +916,14 @@ describe.each([
920
916
921
917
Expression expected"
922
918
` )
923
- } else {
924
- redboxSource = redboxSource . substring (
925
- 0 ,
926
- redboxSource . indexOf ( '`----' )
927
- )
919
+ } else {
920
+ redboxSource = redboxSource . substring (
921
+ 0 ,
922
+ redboxSource . indexOf ( '`----' )
923
+ )
928
924
929
- expect ( next . normalizeTestDirContent ( redboxSource ) )
930
- . toMatchInlineSnapshot ( `
925
+ expect ( next . normalizeTestDirContent ( redboxSource ) )
926
+ . toMatchInlineSnapshot ( `
931
927
"./components/parse-error.js
932
928
Error:
933
929
x Expression expected
@@ -940,31 +936,27 @@ describe.each([
940
936
5 | js
941
937
"
942
938
` )
943
- }
939
+ }
944
940
945
- await next . patchFile ( aboutPage , aboutContent )
941
+ await next . patchFile ( aboutPage , aboutContent )
946
942
943
+ await check ( ( ) => getBrowserBodyText ( browser ) , / T h i s i s t h e a b o u t p a g e / )
944
+ expect ( await hasRedbox ( browser ) ) . toBe ( false )
945
+ } catch ( err ) {
946
+ await next . patchFile ( aboutPage , aboutContent )
947
+
948
+ if ( browser ) {
947
949
await check (
948
950
( ) => getBrowserBodyText ( browser ) ,
949
951
/ T h i s i s t h e a b o u t p a g e /
950
952
)
951
- expect ( await hasRedbox ( browser ) ) . toBe ( false )
952
- } catch ( err ) {
953
- await next . patchFile ( aboutPage , aboutContent )
954
-
955
- if ( browser ) {
956
- await check (
957
- ( ) => getBrowserBodyText ( browser ) ,
958
- / T h i s i s t h e a b o u t p a g e /
959
- )
960
- }
961
- } finally {
962
- if ( browser ) {
963
- await browser . close ( )
964
- }
965
953
}
966
- } )
967
- }
954
+ } finally {
955
+ if ( browser ) {
956
+ await browser . close ( )
957
+ }
958
+ }
959
+ } )
968
960
969
961
it ( 'should recover from errors in getInitialProps in client' , async ( ) => {
970
962
let browser
0 commit comments