refactor: route all decoders through plugin runtime
This commit is contained in:
@@ -37,13 +37,15 @@ test("CW entry appends server-decoded text and registers lifecycle callbacks", a
|
||||
Math,
|
||||
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/cw.js", import.meta.url), "utf8");
|
||||
new vm.Script(runtime).runInContext(context);
|
||||
new vm.Script(source).runInContext(context);
|
||||
|
||||
window.onServerCw({ text: "CQ", wpm: 18, tone_hz: 700, signal_on: true });
|
||||
window.trxPluginRuntime.dispatch("cw", { text: "CQ", wpm: 18, tone_hz: 700, signal_on: true });
|
||||
assert.equal(status.textContent, "Receiving");
|
||||
assert.equal(output.children.length, 1);
|
||||
assert.equal(output.children[0].textContent, "CQ");
|
||||
assert.equal(typeof window.resetCwHistoryView, "function");
|
||||
assert.equal(typeof window.restoreCwHistory, "function");
|
||||
assert.equal(window.onServerCw, undefined);
|
||||
assert.equal(window.trxPluginRuntime.hasDecoder("cw"), true);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user