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

Replace hasRedbox() #67025

Merged
merged 1 commit into from
Jun 20, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe.each(['default', 'turbo'])('ReactRefreshLogBox app %s', () => {
}
`
)
expect(await session.hasRedbox()).toBe(true)
await session.assertHasRedbox()
if (process.env.TURBOPACK) {
expect(await session.getRedboxSource()).toMatchInlineSnapshot(`
"./node_modules/my-package/index.js:1:13
Expand Down Expand Up @@ -92,7 +92,7 @@ describe.each(['default', 'turbo'])('ReactRefreshLogBox app %s', () => {
`
)

expect(await session.hasRedbox()).toBe(true)
await session.assertHasRedbox()

const source = await session.getRedboxSource()
if (process.env.TURBOPACK) {
Expand Down Expand Up @@ -145,7 +145,7 @@ describe.each(['default', 'turbo'])('ReactRefreshLogBox app %s', () => {
`
)

expect(await session.hasRedbox()).toBe(true)
await session.assertHasRedbox()

const source = await session.getRedboxSource()
if (process.env.TURBOPACK) {
Expand Down Expand Up @@ -195,7 +195,7 @@ describe.each(['default', 'turbo'])('ReactRefreshLogBox app %s', () => {
],
])
)
expect(await session.hasRedbox()).toBe(true)
await session.assertHasRedbox()

const source = await session.getRedboxSource()
if (process.env.TURBOPACK) {
Expand Down Expand Up @@ -234,7 +234,7 @@ describe.each(['default', 'turbo'])('ReactRefreshLogBox app %s', () => {
}
`
)
expect(await session.hasRedbox()).toBe(false)
await session.assertNoRedbox()
expect(
await session.evaluate(() => document.documentElement.innerHTML)
).toContain('index page')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ describe.skip('ReactRefreshLogBox scss app', () => {
`
)

expect(await session.hasRedbox()).toBe(false)
await session.assertNoRedbox()

// Syntax error
await session.patch('index.module.scss', `.button { font-size: :5px; }`)
expect(await session.hasRedbox()).toBe(true)
await session.assertHasRedbox()
const source = await session.getRedboxSource()
expect(source).toMatchSnapshot()

// Fix syntax error
await session.patch('index.module.scss', `.button { font-size: 5px; }`)
expect(await session.hasRedbox()).toBe(false)
await session.assertNoRedbox()

await cleanup()
})
Expand All @@ -69,7 +69,7 @@ describe.skip('ReactRefreshLogBox scss app', () => {
// Checks for selectors that can't be prefixed.
// Selector "button" is not pure (pure selectors must contain at least one local class or id)
await session.patch('index.module.scss', `button { font-size: 5px; }`)
expect(await session.hasRedbox()).toBe(true)
await session.assertHasRedbox()
const source2 = await session.getRedboxSource()
expect(source2).toMatchSnapshot()

Expand Down
Loading
Loading