diff --git a/test/acceptance/ReactRefreshLogBox.test.js b/test/acceptance/ReactRefreshLogBox.test.js index 6e66ac10ff519..44e355fee82a2 100644 --- a/test/acceptance/ReactRefreshLogBox.test.js +++ b/test/acceptance/ReactRefreshLogBox.test.js @@ -678,6 +678,35 @@ test('unterminated JSX', async () => { await cleanup() }) +test('Module not found', async () => { + const [session, cleanup] = await sandbox() + + await session.patch( + 'index.js', + ` + import Comp from 'b' + + export default () => { + return ( +
+ lol +
+ ) + } + ` + ) + + expect(await session.hasRedbox(true)).toBe(true) + + const source = await session.getRedboxSource() + expect(source).toMatchInlineSnapshot(` + "./index.js + Module not found: Can't resolve 'b' in '${session.sandboxDirectory}'" + `) + + await cleanup() +}) + test('conversion to class component (1)', async () => { const [session, cleanup] = await sandbox() diff --git a/test/acceptance/helpers.js b/test/acceptance/helpers.js index 56e8964de716f..dca7f95545273 100644 --- a/test/acceptance/helpers.js +++ b/test/acceptance/helpers.js @@ -33,6 +33,7 @@ export async function sandbox(id = nanoid(), initialFiles = new Map()) { return [ { + sandboxDirectory, async write(fileName, content) { // Update the file on filesystem const fullFileName = path.join(sandboxDirectory, fileName)