mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
29 lines
979 B
TypeScript
29 lines
979 B
TypeScript
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"
|
|
`)
|
|
})
|
|
})
|