Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
shuding committed Apr 21, 2021
1 parent 27c60d3 commit 144bb4f
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/acceptance/ReactRefreshLogBox.dev.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1380,3 +1380,28 @@ test('_document top level error shows logbox', async () => {
expect(await session.hasRedbox()).toBe(false)
await cleanup()
})

test('server-side only compilation errors', async () => {
const [session, cleanup] = await sandbox()

await session.patch(
'pages/index.js',
`
import myLibrary from 'my-non-existent-library'
export async function getStaticProps() {
return {
props: {
result: myLibrary()
}
}
}
export default function Hello(props) {
return <h1>{props.result}</h1>
}
`
)

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

await cleanup()
})

0 comments on commit 144bb4f

Please sign in to comment.