From 144bb4fb1389fb2c90964aaac85a6931711b3aea Mon Sep 17 00:00:00 2001 From: Shu Ding Date: Thu, 22 Apr 2021 05:58:55 +0800 Subject: [PATCH] add test --- .../acceptance/ReactRefreshLogBox.dev.test.js | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/test/acceptance/ReactRefreshLogBox.dev.test.js b/test/acceptance/ReactRefreshLogBox.dev.test.js index cad76e203563f..accd3533e8cdc 100644 --- a/test/acceptance/ReactRefreshLogBox.dev.test.js +++ b/test/acceptance/ReactRefreshLogBox.dev.test.js @@ -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

{props.result}

+ } + ` + ) + + expect(await session.hasRedbox(true)).toBe(true) + + await cleanup() +})