Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update flakey polyfills and acceptance tests #45313

Merged
merged 1 commit into from
Jan 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 20 additions & 12 deletions test/development/acceptance-app/ReactRefreshRegression.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,17 @@ describe('ReactRefreshRegression app', () => {
`
)

expect(
await session.evaluate(() => document.querySelector('p').textContent)
).toBe('0')
await check(
() => session.evaluate(() => document.querySelector('p').textContent),
'0'
)

await session.evaluate(() => document.querySelector('button').click())
expect(
await session.evaluate(() => document.querySelector('p').textContent)
).toBe('1')

await check(
() => session.evaluate(() => document.querySelector('p').textContent),
'1'
)

await session.patch(
'index.js',
Expand All @@ -204,13 +208,17 @@ describe('ReactRefreshRegression app', () => {
`
)

expect(
await session.evaluate(() => document.querySelector('p').textContent)
).toBe('Count: 1')
await check(
() => session.evaluate(() => document.querySelector('p').textContent),
'Count: 1'
)

await session.evaluate(() => document.querySelector('button').click())
expect(
await session.evaluate(() => document.querySelector('p').textContent)
).toBe('Count: 2')

await check(
() => session.evaluate(() => document.querySelector('p').textContent),
'Count: 2'
)

await cleanup()
})
Expand Down
3 changes: 2 additions & 1 deletion test/production/disable-fallback-polyfills/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ describe('Disable fallback polyfills', () => {
let next: NextInstance

function getFirstLoadSize(output: string) {
const firstLoadRe = /○ \/\s*(\d*) k?B\s*(?<firstLoad>.*) kB/
const firstLoadRe =
/○ \/.*? (?<size>\d.*?) [^\d]{2} (?<firstLoad>\d.*?) [^\d]{2}/
return Number(output.match(firstLoadRe).groups.firstLoad)
}

Expand Down