From cbbe8ad9992765bc0883759e4075cf7a4a1918ff Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Mon, 11 Jun 2018 18:17:28 +0200 Subject: Add deno_send tests. --- deno2/js/mock_runtime.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'deno2/js/mock_runtime.js') 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); + }); +} -- cgit v1.2.3