summaryrefslogtreecommitdiff
path: root/deno2/js
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-06-11 18:17:28 +0200
committerRyan Dahl <ry@tinyclouds.org>2018-06-11 18:17:28 +0200
commitcbbe8ad9992765bc0883759e4075cf7a4a1918ff (patch)
tree844555d6da87fc08e4ffb3f98a9c9d2742a41dd3 /deno2/js
parent0e07e16dd63992f5f989dc99c891d53d930a2d5b (diff)
Add deno_send tests.
Diffstat (limited to 'deno2/js')
-rw-r--r--deno2/js/mock_runtime.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/deno2/js/mock_runtime.js b/deno2/js/mock_runtime.js
index a91546f85..cd9766685 100644
--- a/deno2/js/mock_runtime.js
+++ b/deno2/js/mock_runtime.js
@@ -7,3 +7,13 @@ window['foo'] = () => {
return "foo";
}
+function assert(cond) {
+ if (!cond) throw Error("assert failed");
+}
+
+function recvabc() {
+ deno_recv((msg) => {
+ assert(msg instanceof ArrayBuffer);
+ assert(msg.byteLength === 3);
+ });
+}