commit 5893c5a3cdc52f0f748b7ab57d23fc2af8d9ede7
parent 507b9017f264cecca8d4d4a1de7e1b24ad6bdb45
Author: William Casarin <jb55@jb55.com>
Date: Fri, 15 Jul 2022 13:04:05 -0700
test: extend js test to include rpc
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/test/connection.js b/test/connection.js
@@ -4,8 +4,6 @@ const t = require('tap')
const LNSocket = require('../')
t.test('connection works', async (t) => {
- t.plan(1)
-
const ln = await LNSocket()
ln.genkey()
@@ -18,10 +16,17 @@ t.test('connection works', async (t) => {
if (!ln.setkey(goodkey))
t.ok(false, "expected goodkey to succeed")
- await ln.connect_and_init("03f3c108ccd536b8526841f0a5c58212bb9e6584a1eb493080e7c1cc34f82dad71", "24.84.152.187")
+ const nodeid = "03f3c108ccd536b8526841f0a5c58212bb9e6584a1eb493080e7c1cc34f82dad71"
+ await ln.connect_and_init(nodeid, "24.84.152.187")
t.ok(ln.connected, "connection works")
+ const rune = "APaeUhcGPAMQwgV1Kn-hRRs5Bi4-D1nrfsHfCoTLl749MTAmbWV0aG9kPWdldGluZm8="
+ const res = await ln.rpc({ method: "getinfo", rune })
+
+ t.ok(res.result, "didn't get result")
+ t.ok(res.result.id === nodeid, "nodeid is wrong!?")
+
ln.destroy()
t.end()
})