refactor: add typed decoder plugin runtime
This commit is contained in:
@@ -25,11 +25,14 @@ test("APRS entry normalizes positioned packets without remote symbol assets", as
|
||||
Reflect,
|
||||
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/aprs.js", import.meta.url), "utf8");
|
||||
assert.equal(source.includes("raw.githubusercontent.com"), false);
|
||||
new vm.Script(runtime).runInContext(context);
|
||||
new vm.Script(source).runInContext(context);
|
||||
|
||||
window.onServerAprs({ src_call: "SP0ABC", dest_call: "APRS", crc_ok: true, lat: 54.5, lon: 18.5, symbol_table: "/", symbol_code: ">" });
|
||||
window.trxPluginRuntime.dispatch("aprs", { src_call: "SP0ABC", dest_call: "APRS", crc_ok: true, lat: 54.5, lon: 18.5, symbol_table: "/", symbol_code: ">" });
|
||||
assert.equal(window.onServerAprs, undefined);
|
||||
assert.equal(forwarded.length, 1);
|
||||
assert.equal(forwarded[0][0], "SP0ABC");
|
||||
assert.equal(forwarded[0][1], 54.5);
|
||||
|
||||
Reference in New Issue
Block a user