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
d11156c2
Unverified
Commit
d11156c2
authored
Oct 25, 2023
by
Tobias Koppers
Committed by
GitHub
Oct 25, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turbopack: disable webpack specific test cases (#57423)
These tests test webpack specific behavior Closes WEB-1857
parent
462b8585
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
34 deletions
+42
-34
hmr.test.ts
test/development/basic/hmr.test.ts
+42
-34
No files found.
test/development/basic/hmr.test.ts
View file @
d11156c2
...
...
@@ -520,45 +520,51 @@ describe.each([[''], ['/docs']])(
}
})
it
(
'should show the error on all pages'
,
async
()
=>
{
const
aboutPage
=
join
(
'pages'
,
'hmr'
,
'about2.js'
)
const
aboutContent
=
await
next
.
readFile
(
aboutPage
)
let
browser
try
{
await
renderViaHTTP
(
next
.
url
,
basePath
+
'/hmr/about2'
)
if
(
!
process
.
env
.
TURBOPACK
)
{
// Turbopack doesn't have this restriction
it
(
'should show the error on all pages'
,
async
()
=>
{
const
aboutPage
=
join
(
'pages'
,
'hmr'
,
'about2.js'
)
const
aboutContent
=
await
next
.
readFile
(
aboutPage
)
let
browser
try
{
await
renderViaHTTP
(
next
.
url
,
basePath
+
'/hmr/about2'
)
await
next
.
patchFile
(
aboutPage
,
aboutContent
.
replace
(
'</div>'
,
'div'
))
await
next
.
patchFile
(
aboutPage
,
aboutContent
.
replace
(
'</div>'
,
'div'
)
)
// Ensure dev server has time to break:
await
new
Promise
((
resolve
)
=>
setTimeout
(
resolve
,
2000
))
// Ensure dev server has time to break:
await
new
Promise
((
resolve
)
=>
setTimeout
(
resolve
,
2000
))
browser
=
await
webdriver
(
next
.
url
,
basePath
+
'/hmr/contact'
)
browser
=
await
webdriver
(
next
.
url
,
basePath
+
'/hmr/contact'
)
expect
(
await
hasRedbox
(
browser
,
true
)).
toBe
(
true
)
expect
(
await
getRedboxSource
(
browser
)).
toMatch
(
/Unexpected eof/
)
expect
(
await
hasRedbox
(
browser
,
true
)).
toBe
(
true
)
expect
(
await
getRedboxSource
(
browser
)).
toMatch
(
/Unexpected eof/
)
await
next
.
patchFile
(
aboutPage
,
aboutContent
)
await
next
.
patchFile
(
aboutPage
,
aboutContent
)
await
check
(
()
=>
getBrowserBodyText
(
browser
),
/This is the contact page/
)
}
catch
(
err
)
{
await
next
.
patchFile
(
aboutPage
,
aboutContent
)
if
(
browser
)
{
await
check
(
()
=>
getBrowserBodyText
(
browser
),
/This is the contact page/
)
}
}
catch
(
err
)
{
await
next
.
patchFile
(
aboutPage
,
aboutContent
)
if
(
browser
)
{
await
check
(
()
=>
getBrowserBodyText
(
browser
),
/This is the contact page/
)
}
throw
err
}
finally
{
if
(
browser
)
{
await
browser
.
close
()
throw
err
}
finally
{
if
(
browser
)
{
await
browser
.
close
()
}
}
}
}
)
}
)
}
it
(
'should detect runtime errors on the module scope'
,
async
()
=>
{
let
browser
...
...
@@ -1116,13 +1122,15 @@ describe.each([[''], ['/docs']])(
})
})
it
(
'should have client HMR events in trace file'
,
async
()
=>
{
const
traceData
=
await
next
.
readFile
(
'.next/trace'
)
expect
(
traceData
).
toContain
(
'client-hmr-latency'
)
expect
(
traceData
).
toContain
(
'client-error'
)
expect
(
traceData
).
toContain
(
'client-success'
)
expect
(
traceData
).
toContain
(
'client-full-reload'
)
})
if
(
!
process
.
env
.
TURBOPACK
)
{
it
(
'should have client HMR events in trace file'
,
async
()
=>
{
const
traceData
=
await
next
.
readFile
(
'.next/trace'
)
expect
(
traceData
).
toContain
(
'client-hmr-latency'
)
expect
(
traceData
).
toContain
(
'client-error'
)
expect
(
traceData
).
toContain
(
'client-success'
)
expect
(
traceData
).
toContain
(
'client-full-reload'
)
})
}
it
(
'should have correct compile timing after fixing error'
,
async
()
=>
{
const
pageName
=
'pages/auto-export-is-ready.js'
...
...
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