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
034ee8ac
Unverified
Commit
034ee8ac
authored
Jan 17, 2023
by
JJ Kasper
Committed by
GitHub
Jan 17, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update some flakey acceptance tests (#44984)
parent
f741b888
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
61 additions
and
55 deletions
+61
-55
ReactRefreshLogBox-scss.test.ts
...evelopment/acceptance-app/ReactRefreshLogBox-scss.test.ts
+2
-2
ReactRefreshLogBox.test.ts
test/development/acceptance-app/ReactRefreshLogBox.test.ts
+11
-11
ReactRefreshLogBoxMisc.test.ts
...development/acceptance-app/ReactRefreshLogBoxMisc.test.ts
+4
-4
ReactRefreshModule.test.ts
test/development/acceptance-app/ReactRefreshModule.test.ts
+2
-2
ReactRefreshRegression.test.ts
...development/acceptance-app/ReactRefreshRegression.test.ts
+9
-6
ReactRefreshLogBox-app-doc.test.ts
...development/acceptance/ReactRefreshLogBox-app-doc.test.ts
+4
-4
ReactRefreshLogBox-scss.test.ts
test/development/acceptance/ReactRefreshLogBox-scss.test.ts
+1
-1
ReactRefreshLogBox.test.ts
test/development/acceptance/ReactRefreshLogBox.test.ts
+13
-13
ReactRefreshLogBoxMisc.test.ts
test/development/acceptance/ReactRefreshLogBoxMisc.test.ts
+4
-4
ReactRefreshModule.test.ts
test/development/acceptance/ReactRefreshModule.test.ts
+2
-2
ReactRefreshRegression.test.ts
test/development/acceptance/ReactRefreshRegression.test.ts
+9
-6
No files found.
test/development/acceptance-app/ReactRefreshLogBox-scss.test.ts
View file @
034ee8ac
...
@@ -38,7 +38,7 @@ describe('ReactRefreshLogBox app', () => {
...
@@ -38,7 +38,7 @@ describe('ReactRefreshLogBox app', () => {
`
`
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
// Syntax error
// Syntax error
await
session
.
patch
(
'index.module.scss'
,
`.button { font-size: :5px; }`
)
await
session
.
patch
(
'index.module.scss'
,
`.button { font-size: :5px; }`
)
...
@@ -48,7 +48,7 @@ describe('ReactRefreshLogBox app', () => {
...
@@ -48,7 +48,7 @@ describe('ReactRefreshLogBox app', () => {
// Fix syntax error
// Fix syntax error
await
session
.
patch
(
'index.module.scss'
,
`.button { font-size: 5px; }`
)
await
session
.
patch
(
'index.module.scss'
,
`.button { font-size: 5px; }`
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
// Not local error
// Not local error
await
session
.
patch
(
'index.module.scss'
,
`button { font-size: 5px; }`
)
await
session
.
patch
(
'index.module.scss'
,
`button { font-size: 5px; }`
)
...
...
test/development/acceptance-app/ReactRefreshLogBox.test.ts
View file @
034ee8ac
...
@@ -107,7 +107,7 @@ for (const variant of ['default', 'turbo']) {
...
@@ -107,7 +107,7 @@ for (const variant of ['default', 'turbo']) {
/Count: 1/
/Count: 1/
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
await
cleanup
()
await
cleanup
()
})
})
...
@@ -169,7 +169,7 @@ for (const variant of ['default', 'turbo']) {
...
@@ -169,7 +169,7 @@ for (const variant of ['default', 'turbo']) {
`
`
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
expect
(
await
session
.
hasErrorToast
()).
toBe
(
false
)
expect
(
await
session
.
hasErrorToast
()).
toBe
(
false
)
expect
(
expect
(
...
@@ -180,7 +180,7 @@ for (const variant of ['default', 'turbo']) {
...
@@ -180,7 +180,7 @@ for (const variant of ['default', 'turbo']) {
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'p'
).
textContent
)
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'p'
).
textContent
)
).
toBe
(
'Count: 2'
)
).
toBe
(
'Count: 2'
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
expect
(
await
session
.
hasErrorToast
()).
toBe
(
false
)
expect
(
await
session
.
hasErrorToast
()).
toBe
(
false
)
await
cleanup
()
await
cleanup
()
...
@@ -242,7 +242,7 @@ for (const variant of ['default', 'turbo']) {
...
@@ -242,7 +242,7 @@ for (const variant of ['default', 'turbo']) {
// TODO-APP: re-enable when error recovery doesn't reload the page.
// TODO-APP: re-enable when error recovery doesn't reload the page.
// expect(didNotReload).toBe(true)
// expect(didNotReload).toBe(true)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
expect
(
expect
(
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'p'
).
textContent
)
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'p'
).
textContent
)
).
toBe
(
'Hello'
)
).
toBe
(
'Hello'
)
...
@@ -526,7 +526,7 @@ for (const variant of ['default', 'turbo']) {
...
@@ -526,7 +526,7 @@ for (const variant of ['default', 'turbo']) {
)
)
// Expected: this fixes the problem
// Expected: this fixes the problem
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
await
cleanup
()
await
cleanup
()
})
})
...
@@ -701,7 +701,7 @@ for (const variant of ['default', 'turbo']) {
...
@@ -701,7 +701,7 @@ for (const variant of ['default', 'turbo']) {
`
`
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
await
session
.
patch
(
await
session
.
patch
(
'index.js'
,
'index.js'
,
...
@@ -752,7 +752,7 @@ for (const variant of ['default', 'turbo']) {
...
@@ -752,7 +752,7 @@ for (const variant of ['default', 'turbo']) {
`
`
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
expect
(
expect
(
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'p'
).
textContent
)
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'p'
).
textContent
)
).
toBe
(
'hello'
)
).
toBe
(
'hello'
)
...
@@ -784,7 +784,7 @@ for (const variant of ['default', 'turbo']) {
...
@@ -784,7 +784,7 @@ for (const variant of ['default', 'turbo']) {
`
`
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
expect
(
expect
(
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'p'
).
textContent
)
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'p'
).
textContent
)
).
toBe
(
'hello new'
)
).
toBe
(
'hello new'
)
...
@@ -810,7 +810,7 @@ for (const variant of ['default', 'turbo']) {
...
@@ -810,7 +810,7 @@ for (const variant of ['default', 'turbo']) {
`
`
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
// Syntax error
// Syntax error
await
session
.
patch
(
'index.module.css'
,
`.button {`
)
await
session
.
patch
(
'index.module.css'
,
`.button {`
)
...
@@ -1219,7 +1219,7 @@ for (const variant of ['default', 'turbo']) {
...
@@ -1219,7 +1219,7 @@ for (const variant of ['default', 'turbo']) {
()
=>
browser
.
elementByCss
(
'.nextjs-toast-errors'
).
text
(),
()
=>
browser
.
elementByCss
(
'.nextjs-toast-errors'
).
text
(),
/4 errors/
/4 errors/
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
// Add Component error
// Add Component error
await
session
.
patch
(
await
session
.
patch
(
...
@@ -1328,7 +1328,7 @@ for (const variant of ['default', 'turbo']) {
...
@@ -1328,7 +1328,7 @@ for (const variant of ['default', 'turbo']) {
expect
(
await
browser
.
waitForElementByCss
(
'#text'
).
text
()).
toBe
(
expect
(
await
browser
.
waitForElementByCss
(
'#text'
).
text
()).
toBe
(
'Hello world'
'Hello world'
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
// Re-add error
// Re-add error
await
session
.
patch
(
await
session
.
patch
(
...
...
test/development/acceptance-app/ReactRefreshLogBoxMisc.test.ts
View file @
034ee8ac
...
@@ -88,7 +88,7 @@ describe.skip('ReactRefreshLogBox app', () => {
...
@@ -88,7 +88,7 @@ describe.skip('ReactRefreshLogBox app', () => {
}
}
`
`
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
await
session
.
patch
(
await
session
.
patch
(
'index.js'
,
'index.js'
,
...
@@ -112,7 +112,7 @@ describe.skip('ReactRefreshLogBox app', () => {
...
@@ -112,7 +112,7 @@ describe.skip('ReactRefreshLogBox app', () => {
}
}
`
`
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
await
session
.
patch
(
await
session
.
patch
(
'index.js'
,
'index.js'
,
...
@@ -136,7 +136,7 @@ describe.skip('ReactRefreshLogBox app', () => {
...
@@ -136,7 +136,7 @@ describe.skip('ReactRefreshLogBox app', () => {
}
}
`
`
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
await
session
.
patch
(
await
session
.
patch
(
'index.js'
,
'index.js'
,
...
@@ -160,7 +160,7 @@ describe.skip('ReactRefreshLogBox app', () => {
...
@@ -160,7 +160,7 @@ describe.skip('ReactRefreshLogBox app', () => {
}
}
`
`
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
await
session
.
patch
(
await
session
.
patch
(
'index.js'
,
'index.js'
,
...
...
test/development/acceptance-app/ReactRefreshModule.test.ts
View file @
034ee8ac
...
@@ -20,7 +20,7 @@ describe('ReactRefreshModule app', () => {
...
@@ -20,7 +20,7 @@ describe('ReactRefreshModule app', () => {
it
(
'should allow any variable names'
,
async
()
=>
{
it
(
'should allow any variable names'
,
async
()
=>
{
const
{
session
,
cleanup
}
=
await
sandbox
(
next
,
new
Map
([]))
const
{
session
,
cleanup
}
=
await
sandbox
(
next
,
new
Map
([]))
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
const
variables
=
[
const
variables
=
[
'_a'
,
'_a'
,
...
@@ -39,7 +39,7 @@ describe('ReactRefreshModule app', () => {
...
@@ -39,7 +39,7 @@ describe('ReactRefreshModule app', () => {
return null
return null
}`
}`
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
expect
(
next
.
cliOutput
).
not
.
toContain
(
expect
(
next
.
cliOutput
).
not
.
toContain
(
`'
${
variable
}
' has already been declared`
`'
${
variable
}
' has already been declared`
)
)
...
...
test/development/acceptance-app/ReactRefreshRegression.test.ts
View file @
034ee8ac
...
@@ -3,6 +3,7 @@ import { sandbox } from './helpers'
...
@@ -3,6 +3,7 @@ import { sandbox } from './helpers'
import
{
createNext
,
FileRef
}
from
'e2e-utils'
import
{
createNext
,
FileRef
}
from
'e2e-utils'
import
{
NextInstance
}
from
'test/lib/next-modes/base'
import
{
NextInstance
}
from
'test/lib/next-modes/base'
import
path
from
'path'
import
path
from
'path'
import
{
check
}
from
'next-test-utils'
describe
(
'ReactRefreshRegression app'
,
()
=>
{
describe
(
'ReactRefreshRegression app'
,
()
=>
{
let
next
:
NextInstance
let
next
:
NextInstance
...
@@ -80,7 +81,7 @@ describe('ReactRefreshRegression app', () => {
...
@@ -80,7 +81,7 @@ describe('ReactRefreshRegression app', () => {
)
)
// Verify no hydration mismatch:
// Verify no hydration mismatch:
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
await
cleanup
()
await
cleanup
()
})
})
...
@@ -250,9 +251,11 @@ describe('ReactRefreshRegression app', () => {
...
@@ -250,9 +251,11 @@ describe('ReactRefreshRegression app', () => {
`
`
)
)
expect
(
await
check
(
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'p'
).
textContent
)
()
=>
session
.
evaluate
(()
=>
document
.
querySelector
(
'p'
).
textContent
),
).
toBe
(
'0'
)
'0'
)
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'button'
).
click
())
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'button'
).
click
())
expect
(
expect
(
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'p'
).
textContent
)
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'p'
).
textContent
)
...
@@ -356,7 +359,7 @@ describe('ReactRefreshRegression app', () => {
...
@@ -356,7 +359,7 @@ describe('ReactRefreshRegression app', () => {
let
didNotReload
=
await
session
.
patch
(
'app/content.mdx'
,
`Hello Foo!`
)
let
didNotReload
=
await
session
.
patch
(
'app/content.mdx'
,
`Hello Foo!`
)
expect
(
didNotReload
).
toBe
(
true
)
expect
(
didNotReload
).
toBe
(
true
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
expect
(
expect
(
await
session
.
evaluate
(
await
session
.
evaluate
(
()
=>
document
.
querySelector
(
'#content'
).
textContent
()
=>
document
.
querySelector
(
'#content'
).
textContent
...
@@ -365,7 +368,7 @@ describe('ReactRefreshRegression app', () => {
...
@@ -365,7 +368,7 @@ describe('ReactRefreshRegression app', () => {
didNotReload
=
await
session
.
patch
(
'app/content.mdx'
,
`Hello Bar!`
)
didNotReload
=
await
session
.
patch
(
'app/content.mdx'
,
`Hello Bar!`
)
expect
(
didNotReload
).
toBe
(
true
)
expect
(
didNotReload
).
toBe
(
true
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
expect
(
expect
(
await
session
.
evaluate
(
await
session
.
evaluate
(
()
=>
document
.
querySelector
(
'#content'
).
textContent
()
=>
document
.
querySelector
(
'#content'
).
textContent
...
...
test/development/acceptance/ReactRefreshLogBox-app-doc.test.ts
View file @
034ee8ac
...
@@ -41,7 +41,7 @@ for (const variant of ['default', 'turbo']) {
...
@@ -41,7 +41,7 @@ for (const variant of ['default', 'turbo']) {
export default MyApp
export default MyApp
`
`
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
await
cleanup
()
await
cleanup
()
})
})
...
@@ -89,7 +89,7 @@ for (const variant of ['default', 'turbo']) {
...
@@ -89,7 +89,7 @@ for (const variant of ['default', 'turbo']) {
export default MyDocument
export default MyDocument
`
`
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
await
cleanup
()
await
cleanup
()
})
})
...
@@ -120,7 +120,7 @@ for (const variant of ['default', 'turbo']) {
...
@@ -120,7 +120,7 @@ for (const variant of ['default', 'turbo']) {
export default MyApp
export default MyApp
`
`
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
await
cleanup
()
await
cleanup
()
})
})
...
@@ -187,7 +187,7 @@ for (const variant of ['default', 'turbo']) {
...
@@ -187,7 +187,7 @@ for (const variant of ['default', 'turbo']) {
export default MyDocument
export default MyDocument
`
`
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
await
cleanup
()
await
cleanup
()
})
})
})
})
...
...
test/development/acceptance/ReactRefreshLogBox-scss.test.ts
View file @
034ee8ac
...
@@ -37,7 +37,7 @@ describe.skip('ReactRefreshLogBox', () => {
...
@@ -37,7 +37,7 @@ describe.skip('ReactRefreshLogBox', () => {
`
`
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
// Syntax error
// Syntax error
await
session
.
patch
(
'index.module.scss'
,
`.button { font-size: :5px; }`
)
await
session
.
patch
(
'index.module.scss'
,
`.button { font-size: :5px; }`
)
...
...
test/development/acceptance/ReactRefreshLogBox.test.ts
View file @
034ee8ac
...
@@ -100,7 +100,7 @@ for (const variant of ['default', 'turbo']) {
...
@@ -100,7 +100,7 @@ for (const variant of ['default', 'turbo']) {
/Count: 1/
/Count: 1/
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
await
cleanup
()
await
cleanup
()
})
})
...
@@ -162,7 +162,7 @@ for (const variant of ['default', 'turbo']) {
...
@@ -162,7 +162,7 @@ for (const variant of ['default', 'turbo']) {
`
`
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
expect
(
expect
(
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'p'
).
textContent
)
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'p'
).
textContent
)
...
@@ -172,7 +172,7 @@ for (const variant of ['default', 'turbo']) {
...
@@ -172,7 +172,7 @@ for (const variant of ['default', 'turbo']) {
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'p'
).
textContent
)
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'p'
).
textContent
)
).
toBe
(
'Count: 2'
)
).
toBe
(
'Count: 2'
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
await
cleanup
()
await
cleanup
()
})
})
...
@@ -231,7 +231,7 @@ for (const variant of ['default', 'turbo']) {
...
@@ -231,7 +231,7 @@ for (const variant of ['default', 'turbo']) {
)
)
expect
(
didNotReload
).
toBe
(
true
)
expect
(
didNotReload
).
toBe
(
true
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
expect
(
expect
(
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'p'
).
textContent
)
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'p'
).
textContent
)
).
toBe
(
'Hello'
)
).
toBe
(
'Hello'
)
...
@@ -422,7 +422,7 @@ for (const variant of ['default', 'turbo']) {
...
@@ -422,7 +422,7 @@ for (const variant of ['default', 'turbo']) {
)
)
// Expected: this fixes the problem
// Expected: this fixes the problem
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
await
cleanup
()
await
cleanup
()
})
})
...
@@ -597,7 +597,7 @@ for (const variant of ['default', 'turbo']) {
...
@@ -597,7 +597,7 @@ for (const variant of ['default', 'turbo']) {
`
`
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
await
session
.
patch
(
await
session
.
patch
(
'index.js'
,
'index.js'
,
...
@@ -648,7 +648,7 @@ for (const variant of ['default', 'turbo']) {
...
@@ -648,7 +648,7 @@ for (const variant of ['default', 'turbo']) {
`
`
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
expect
(
expect
(
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'p'
).
textContent
)
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'p'
).
textContent
)
).
toBe
(
'hello'
)
).
toBe
(
'hello'
)
...
@@ -680,7 +680,7 @@ for (const variant of ['default', 'turbo']) {
...
@@ -680,7 +680,7 @@ for (const variant of ['default', 'turbo']) {
`
`
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
expect
(
expect
(
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'p'
).
textContent
)
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'p'
).
textContent
)
).
toBe
(
'hello new'
)
).
toBe
(
'hello new'
)
...
@@ -706,7 +706,7 @@ for (const variant of ['default', 'turbo']) {
...
@@ -706,7 +706,7 @@ for (const variant of ['default', 'turbo']) {
`
`
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
// Syntax error
// Syntax error
await
session
.
patch
(
'index.module.css'
,
`.button {`
)
await
session
.
patch
(
'index.module.css'
,
`.button {`
)
...
@@ -748,7 +748,7 @@ for (const variant of ['default', 'turbo']) {
...
@@ -748,7 +748,7 @@ for (const variant of ['default', 'turbo']) {
`
`
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'button'
).
click
())
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'button'
).
click
())
expect
(
await
session
.
hasRedbox
(
true
)).
toBe
(
true
)
expect
(
await
session
.
hasRedbox
(
true
)).
toBe
(
true
)
...
@@ -794,7 +794,7 @@ for (const variant of ['default', 'turbo']) {
...
@@ -794,7 +794,7 @@ for (const variant of ['default', 'turbo']) {
`
`
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'button'
).
click
())
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'button'
).
click
())
expect
(
await
session
.
hasRedbox
(
true
)).
toBe
(
true
)
expect
(
await
session
.
hasRedbox
(
true
)).
toBe
(
true
)
...
@@ -840,7 +840,7 @@ for (const variant of ['default', 'turbo']) {
...
@@ -840,7 +840,7 @@ for (const variant of ['default', 'turbo']) {
`
`
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'button'
).
click
())
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'button'
).
click
())
expect
(
await
session
.
hasRedbox
(
true
)).
toBe
(
true
)
expect
(
await
session
.
hasRedbox
(
true
)).
toBe
(
true
)
...
@@ -886,7 +886,7 @@ for (const variant of ['default', 'turbo']) {
...
@@ -886,7 +886,7 @@ for (const variant of ['default', 'turbo']) {
`
`
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'button'
).
click
())
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'button'
).
click
())
expect
(
await
session
.
hasRedbox
(
true
)).
toBe
(
true
)
expect
(
await
session
.
hasRedbox
(
true
)).
toBe
(
true
)
...
...
test/development/acceptance/ReactRefreshLogBoxMisc.test.ts
View file @
034ee8ac
...
@@ -83,7 +83,7 @@ describe.skip('ReactRefreshLogBox', () => {
...
@@ -83,7 +83,7 @@ describe.skip('ReactRefreshLogBox', () => {
}
}
`
`
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
await
session
.
patch
(
await
session
.
patch
(
'index.js'
,
'index.js'
,
...
@@ -107,7 +107,7 @@ describe.skip('ReactRefreshLogBox', () => {
...
@@ -107,7 +107,7 @@ describe.skip('ReactRefreshLogBox', () => {
}
}
`
`
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
await
session
.
patch
(
await
session
.
patch
(
'index.js'
,
'index.js'
,
...
@@ -131,7 +131,7 @@ describe.skip('ReactRefreshLogBox', () => {
...
@@ -131,7 +131,7 @@ describe.skip('ReactRefreshLogBox', () => {
}
}
`
`
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
await
session
.
patch
(
await
session
.
patch
(
'index.js'
,
'index.js'
,
...
@@ -155,7 +155,7 @@ describe.skip('ReactRefreshLogBox', () => {
...
@@ -155,7 +155,7 @@ describe.skip('ReactRefreshLogBox', () => {
}
}
`
`
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
await
session
.
patch
(
await
session
.
patch
(
'index.js'
,
'index.js'
,
...
...
test/development/acceptance/ReactRefreshModule.test.ts
View file @
034ee8ac
...
@@ -15,7 +15,7 @@ describe('ReactRefreshModule', () => {
...
@@ -15,7 +15,7 @@ describe('ReactRefreshModule', () => {
it
(
'should allow any variable names'
,
async
()
=>
{
it
(
'should allow any variable names'
,
async
()
=>
{
const
{
session
,
cleanup
}
=
await
sandbox
(
next
,
new
Map
([]))
const
{
session
,
cleanup
}
=
await
sandbox
(
next
,
new
Map
([]))
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
const
variables
=
[
const
variables
=
[
'_a'
,
'_a'
,
...
@@ -33,7 +33,7 @@ describe('ReactRefreshModule', () => {
...
@@ -33,7 +33,7 @@ describe('ReactRefreshModule', () => {
return null
return null
}`
}`
)
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
expect
(
next
.
cliOutput
).
not
.
toContain
(
expect
(
next
.
cliOutput
).
not
.
toContain
(
`'
${
variable
}
' has already been declared`
`'
${
variable
}
' has already been declared`
)
)
...
...
test/development/acceptance/ReactRefreshRegression.test.ts
View file @
034ee8ac
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
import
{
sandbox
}
from
'./helpers'
import
{
sandbox
}
from
'./helpers'
import
{
createNext
}
from
'e2e-utils'
import
{
createNext
}
from
'e2e-utils'
import
{
NextInstance
}
from
'test/lib/next-modes/base'
import
{
NextInstance
}
from
'test/lib/next-modes/base'
import
{
check
}
from
'next-test-utils'
describe
(
'ReactRefreshRegression'
,
()
=>
{
describe
(
'ReactRefreshRegression'
,
()
=>
{
let
next
:
NextInstance
let
next
:
NextInstance
...
@@ -76,7 +77,7 @@ describe('ReactRefreshRegression', () => {
...
@@ -76,7 +77,7 @@ describe('ReactRefreshRegression', () => {
)
)
// Verify no hydration mismatch:
// Verify no hydration mismatch:
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
await
cleanup
()
await
cleanup
()
})
})
...
@@ -231,9 +232,11 @@ describe('ReactRefreshRegression', () => {
...
@@ -231,9 +232,11 @@ describe('ReactRefreshRegression', () => {
`
`
)
)
expect
(
await
check
(
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'p'
).
textContent
)
()
=>
session
.
evaluate
(()
=>
document
.
querySelector
(
'p'
).
textContent
),
).
toBe
(
'0'
)
'0'
)
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'button'
).
click
())
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'button'
).
click
())
expect
(
expect
(
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'p'
).
textContent
)
await
session
.
evaluate
(()
=>
document
.
querySelector
(
'p'
).
textContent
)
...
@@ -319,7 +322,7 @@ describe('ReactRefreshRegression', () => {
...
@@ -319,7 +322,7 @@ describe('ReactRefreshRegression', () => {
let
didNotReload
=
await
session
.
patch
(
'pages/index.mdx'
,
`Hello Foo!`
)
let
didNotReload
=
await
session
.
patch
(
'pages/index.mdx'
,
`Hello Foo!`
)
expect
(
didNotReload
).
toBe
(
true
)
expect
(
didNotReload
).
toBe
(
true
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
expect
(
expect
(
await
session
.
evaluate
(
await
session
.
evaluate
(
()
=>
document
.
querySelector
(
'#__next'
).
textContent
()
=>
document
.
querySelector
(
'#__next'
).
textContent
...
@@ -328,7 +331,7 @@ describe('ReactRefreshRegression', () => {
...
@@ -328,7 +331,7 @@ describe('ReactRefreshRegression', () => {
didNotReload
=
await
session
.
patch
(
'pages/index.mdx'
,
`Hello Bar!`
)
didNotReload
=
await
session
.
patch
(
'pages/index.mdx'
,
`Hello Bar!`
)
expect
(
didNotReload
).
toBe
(
true
)
expect
(
didNotReload
).
toBe
(
true
)
expect
(
await
session
.
hasRedbox
()).
toBe
(
false
)
expect
(
await
session
.
hasRedbox
(
false
)).
toBe
(
false
)
expect
(
expect
(
await
session
.
evaluate
(
await
session
.
evaluate
(
()
=>
document
.
querySelector
(
'#__next'
).
textContent
()
=>
document
.
querySelector
(
'#__next'
).
textContent
...
...
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