refactor: add typed decoder plugin runtime
This commit is contained in:
@@ -22,10 +22,13 @@ test("VDES entry normalizes and forwards positioned server messages", async () =
|
||||
Array,
|
||||
console,
|
||||
});
|
||||
const runtime = await readFile(new URL("../../assets/web/generated/plugin-runtime.js", import.meta.url), "utf8");
|
||||
const source = await readFile(new URL("../../assets/web/generated/vdes.js", import.meta.url), "utf8");
|
||||
new vm.Script(runtime).runInContext(context);
|
||||
new vm.Script(source).runInContext(context);
|
||||
|
||||
window.onServerVdes({ callsign: "SP0ABC", lat: 54.5, lon: 18.5, bit_len: 120, ts_ms: Date.now() });
|
||||
window.trxPluginRuntime.dispatch("vdes", { callsign: "SP0ABC", lat: 54.5, lon: 18.5, bit_len: 120, ts_ms: Date.now() });
|
||||
assert.equal(window.onServerVdes, undefined);
|
||||
assert.equal(forwarded.length, 1);
|
||||
assert.equal(forwarded[0].callsign, "SP0ABC");
|
||||
assert.equal(forwarded[0].rig_id, null);
|
||||
|
||||
Reference in New Issue
Block a user