edge-runtime icon indicating copy to clipboard operation
edge-runtime copied to clipboard

Node API `Buffer` is available on `@edge-runtime/jest-environment`

Open guisehn opened this issue 1 year ago • 0 comments

Bug Report

The @edge-runtime/jest-environment package allows simulating the Edge runtime when running Jest in a node environment, so it should not allow access to node apis such as Buffer.

Current behavior

Right now, it's possible to access Buffer in a test case.

Expected behavior/code

Buffer will not be available in production when using the edge runtime, so it should also be unavailable in tests.

That way, we can catch in tests when unavailable APIs are used.

Possible solution

https://github.com/vercel/edge-runtime/pull/953

guisehn avatar Aug 24 '24 04:08 guisehn