mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
11 lines
307 B
JavaScript
11 lines
307 B
JavaScript
import { expect, it } from "bun:test";
|
|
|
|
it("shadow realm works", () => {
|
|
const red = new ShadowRealm();
|
|
globalThis.someValue = 1;
|
|
// Affects only the ShadowRealm's global
|
|
const result = red.evaluate("globalThis.someValue = 2;");
|
|
expect(globalThis.someValue).toBe(1);
|
|
expect(result).toBe(2);
|
|
});
|