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
b33bc2df
Unverified
Commit
b33bc2df
authored
Jun 13, 2022
by
JJ Kasper
Committed by
GitHub
Jun 13, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update flakey next-script tests (#37663)
parent
6f698405
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
20 deletions
+19
-20
index.test.ts
test/e2e/next-script/index.test.ts
+19
-20
No files found.
test/e2e/next-script/index.test.ts
View file @
b33bc2df
...
...
@@ -2,7 +2,7 @@ import webdriver from 'next-webdriver'
import
{
createNext
}
from
'e2e-utils'
import
{
NextInstance
}
from
'test/lib/next-modes/base'
import
{
BrowserInterface
}
from
'test/lib/browsers/base'
import
{
waitFor
}
from
'next-test-utils'
import
{
check
}
from
'next-test-utils'
describe
(
'beforeInteractive'
,
()
=>
{
let
next
:
NextInstance
...
...
@@ -188,14 +188,13 @@ describe('experimental.nextScriptWorkers: true with required Partytown dependenc
expect
(
predefinedWorkerScripts
).
toBeGreaterThan
(
0
)
await
waitFor
(
1000
)
// Partytown modifes type to "text/partytown-x" after it has been executed in the web worker
const
processedWorkerScripts
=
await
browser
.
eval
(
`document.querySelectorAll('script[type="text/partytown-x"]').length`
)
expect
(
processedWorkerScripts
).
toBeGreaterThan
(
0
)
await
check
(
async
()
=>
{
const
processedWorkerScripts
=
await
browser
.
eval
(
`document.querySelectorAll('script[type="text/partytown-x"]').length`
)
return
processedWorkerScripts
>
0
?
'success'
:
processedWorkerScripts
},
'success'
)
}
finally
{
if
(
browser
)
await
browser
.
close
()
}
...
...
@@ -249,13 +248,13 @@ describe('experimental.nextScriptWorkers: true with required Partytown dependenc
)
expect
(
predefinedWorkerScripts
).
toEqual
(
1
)
await
waitFor
(
1000
)
// Partytown modifes type to "text/partytown-x" after it has been executed in the web worker
const
processedWorkerScripts
=
await
browser
.
eval
(
`document.querySelectorAll('script[type="text/partytown-x"]').length`
)
expect
(
processedWorkerScripts
).
toEqual
(
1
)
await
check
(
async
()
=>
{
const
processedWorkerScripts
=
await
browser
.
eval
(
`document.querySelectorAll('script[type="text/partytown-x"]').length`
)
return
processedWorkerScripts
+
''
},
'1'
)
const
text
=
await
browser
.
elementById
(
'text'
).
text
()
expect
(
text
).
toBe
(
'abc'
)
...
...
@@ -281,13 +280,13 @@ describe('experimental.nextScriptWorkers: true with required Partytown dependenc
)
expect
(
predefinedWorkerScripts
).
toEqual
(
1
)
await
waitFor
(
1000
)
// Partytown modifes type to "text/partytown-x" after it has been executed in the web worker
const
processedWorkerScripts
=
await
browser
.
eval
(
`document.querySelectorAll('script[type="text/partytown-x"]').length`
)
expect
(
processedWorkerScripts
).
toEqual
(
1
)
await
check
(
async
()
=>
{
const
processedWorkerScripts
=
await
browser
.
eval
(
`document.querySelectorAll('script[type="text/partytown-x"]').length`
)
return
processedWorkerScripts
+
''
},
'1'
)
const
text
=
await
browser
.
elementById
(
'text'
).
text
()
expect
(
text
).
toBe
(
'abcd'
)
...
...
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