/
githubmirror
/
next.js
Обзор
Документация
Войти
/
githubmirror
/
next.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
canary
test/development/app-dir/externalize-node-binary-browser-error/externalize-node-binary-browser-error.test.ts
28 строк
979 B
Sebastian "Sebbie" Silbermann
[test] `assert*` -> `waitFor*` when the util is not instant (#85450)
30 окт 2025, 16:44
Не верифицирован
30 окт 2025, 16:44
0b58a32
Код
Авторство
О чём код?
import { nextTestSetup } from 'e2e-utils' import { waitForRedbox, getRedboxDescription, getRedboxSource, } from 'next-test-utils' // FIXME: er-enable when we have a better implementation of node binary resolving describe.skip('externalize-node-binary-browser-error', () => { const { next } = nextTestSetup({ files: __dirname, }) it('should error when import node binary on browser side', async () => { const browser = await next.browser('/') await waitForRedbox(browser) const redbox = { description: await getRedboxDescription(browser), source: await getRedboxSource(browser), } expect(redbox.description).toBe('Failed to compile') expect(redbox.source).toMatchInlineSnapshot(` "./node_modules/foo-browser-import-binary/binary.node Error: Node.js binary module ./node_modules/foo-browser-import-binary/binary.node is not supported in the browser. Please only use the module on server side" `) }) })