summaryrefslogtreecommitdiff
path: root/cli/tests/unit/structured_clone_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit/structured_clone_test.ts')
-rw-r--r--cli/tests/unit/structured_clone_test.ts13
1 files changed, 12 insertions, 1 deletions
diff --git a/cli/tests/unit/structured_clone_test.ts b/cli/tests/unit/structured_clone_test.ts
index f25276165..fdad0dba7 100644
--- a/cli/tests/unit/structured_clone_test.ts
+++ b/cli/tests/unit/structured_clone_test.ts
@@ -1,4 +1,4 @@
-import { assert, assertEquals } from "./test_util.ts";
+import { assert, assertEquals, assertThrows } from "./test_util.ts";
// Basic tests for the structured clone algorithm. Mainly tests TypeScript
// typings. Actual functionality is tested in WPT.
@@ -17,3 +17,14 @@ Deno.test("self.structuredClone", async () => {
channelOriginal.port1.close();
portTransferred.close();
});
+
+Deno.test("correct DataCloneError message", () => {
+ assertThrows(
+ () => {
+ const sab = new SharedArrayBuffer(1024);
+ structuredClone(sab, { transfer: [sab] });
+ },
+ DOMException,
+ "Value not transferable",
+ );
+});