aboutsummaryrefslogtreecommitdiff
path: root/integration/bunjs-only-snippets/shadow.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'integration/bunjs-only-snippets/shadow.test.js')
-rw-r--r--integration/bunjs-only-snippets/shadow.test.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/integration/bunjs-only-snippets/shadow.test.js b/integration/bunjs-only-snippets/shadow.test.js
new file mode 100644
index 000000000..3fffcac90
--- /dev/null
+++ b/integration/bunjs-only-snippets/shadow.test.js
@@ -0,0 +1,10 @@
+import { describe, it, expect } 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);
+});