Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
190faf4d
Commit
190faf4d
authored
Sep 30, 2024
by
JJ Kasper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fully skip flakey assertion
parent
3020a118
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
50 deletions
+42
-50
hmr.test.ts
test/development/basic/hmr.test.ts
+42
-50
No files found.
test/development/basic/hmr.test.ts
View file @
190faf4d
...
...
@@ -879,36 +879,32 @@ describe.each([
}
})
// assertion is highly flakey in turbopack mode
if
(
!
process
.
env
.
TURBOPACK
)
{
it
(
'should recover after loader parse error in an imported file'
,
async
()
=>
{
let
browser
const
aboutPage
=
join
(
'pages'
,
'hmr'
,
'about9.js'
)
// assertion is highly flakey
it
.
skip
(
'should recover after loader parse error in an imported file'
,
async
()
=>
{
let
browser
const
aboutPage
=
join
(
'pages'
,
'hmr'
,
'about9.js'
)
const
aboutContent
=
await
next
.
readFile
(
aboutPage
)
try
{
browser
=
await
webdriver
(
next
.
appPort
,
basePath
+
'/hmr/about9'
)
await
check
(
()
=>
getBrowserBodyText
(
browser
),
/This is the about page/
)
const
aboutContent
=
await
next
.
readFile
(
aboutPage
)
try
{
browser
=
await
webdriver
(
next
.
appPort
,
basePath
+
'/hmr/about9'
)
await
check
(()
=>
getBrowserBodyText
(
browser
),
/This is the about page/
)
await
next
.
patchFile
(
aboutPage
,
aboutContent
.
replace
(
'export default'
,
'import "../../components/parse-error.js"
\
nexport default'
)
await
next
.
patchFile
(
aboutPage
,
aboutContent
.
replace
(
'export default'
,
'import "../../components/parse-error.js"
\
nexport default'
)
)
expect
(
await
hasRedbox
(
browser
)).
toBe
(
true
)
expect
(
await
getRedboxHeader
(
browser
)).
toMatch
(
'Failed to compile'
)
let
redboxSource
=
await
getRedboxSource
(
browser
)
expect
(
await
hasRedbox
(
browser
)).
toBe
(
true
)
expect
(
await
getRedboxHeader
(
browser
)).
toMatch
(
'Failed to compile'
)
let
redboxSource
=
await
getRedboxSource
(
browser
)
redboxSource
=
redboxSource
.
replace
(
`
${
next
.
testDir
}
`
,
'.'
)
if
(
process
.
env
.
TURBOPACK
)
{
expect
(
next
.
normalizeTestDirContent
(
redboxSource
))
.
toMatchInlineSnapshot
(
`
redboxSource
=
redboxSource
.
replace
(
`
${
next
.
testDir
}
`
,
'.'
)
if
(
process
.
env
.
TURBOPACK
)
{
expect
(
next
.
normalizeTestDirContent
(
redboxSource
))
.
toMatchInlineSnapshot
(
`
"./components/parse-error.js:3:1
Parsing ecmascript source code failed
1 | This
...
...
@@ -920,14 +916,14 @@ describe.each([
Expression expected"
`
)
}
else
{
redboxSource
=
redboxSource
.
substring
(
0
,
redboxSource
.
indexOf
(
'`----'
)
)
}
else
{
redboxSource
=
redboxSource
.
substring
(
0
,
redboxSource
.
indexOf
(
'`----'
)
)
expect
(
next
.
normalizeTestDirContent
(
redboxSource
))
.
toMatchInlineSnapshot
(
`
expect
(
next
.
normalizeTestDirContent
(
redboxSource
))
.
toMatchInlineSnapshot
(
`
"./components/parse-error.js
Error:
x Expression expected
...
...
@@ -940,31 +936,27 @@ describe.each([
5 | js
"
`
)
}
}
await
next
.
patchFile
(
aboutPage
,
aboutContent
)
await
next
.
patchFile
(
aboutPage
,
aboutContent
)
await
check
(()
=>
getBrowserBodyText
(
browser
),
/This is the about page/
)
expect
(
await
hasRedbox
(
browser
)).
toBe
(
false
)
}
catch
(
err
)
{
await
next
.
patchFile
(
aboutPage
,
aboutContent
)
if
(
browser
)
{
await
check
(
()
=>
getBrowserBodyText
(
browser
),
/This is the about page/
)
expect
(
await
hasRedbox
(
browser
)).
toBe
(
false
)
}
catch
(
err
)
{
await
next
.
patchFile
(
aboutPage
,
aboutContent
)
if
(
browser
)
{
await
check
(
()
=>
getBrowserBodyText
(
browser
),
/This is the about page/
)
}
}
finally
{
if
(
browser
)
{
await
browser
.
close
()
}
}
})
}
}
finally
{
if
(
browser
)
{
await
browser
.
close
()
}
}
})
it
(
'should recover from errors in getInitialProps in client'
,
async
()
=>
{
let
browser
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment