working
This commit is contained in:
@@ -4,7 +4,7 @@ const assert = require('node:assert/strict');
|
||||
const NodeClass = require('../../src/nodeClass');
|
||||
const { makeNodeStub, makeREDStub } = require('../helpers/factories');
|
||||
|
||||
test('measurement topic ignores non-number payloads (current behavior)', () => {
|
||||
test('measurement topic accepts numeric strings and ignores non-numeric objects', () => {
|
||||
const inst = Object.create(NodeClass.prototype);
|
||||
const node = makeNodeStub();
|
||||
const calls = [];
|
||||
@@ -24,5 +24,5 @@ test('measurement topic ignores non-number payloads (current behavior)', () => {
|
||||
onInput({ topic: 'measurement', payload: '42' }, () => {}, () => {});
|
||||
onInput({ topic: 'measurement', payload: { value: 42 } }, () => {}, () => {});
|
||||
|
||||
assert.equal(calls.length, 0);
|
||||
assert.deepEqual(calls, [42]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user