const test = require('node:test'); const assert = require('node:assert/strict'); const NodeClass = require('../../src/nodeClass'); const { makeNodeStub, makeREDStub } = require('../helpers/factories'); test('unknown input topic does not throw and still calls done', () => { const inst = Object.create(NodeClass.prototype); const node = makeNodeStub(); inst.node = node; inst.RED = makeREDStub(); inst.source = { childRegistrationUtils: { registerChild() {}, }, updateState() {}, }; inst._attachInputHandler(); let doneCalled = 0; assert.doesNotThrow(() => { node._handlers.input({ topic: 'somethingUnknown', payload: 1 }, () => {}, () => { doneCalled += 1; }); }); assert.equal(doneCalled, 1); });