updates
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('registerChild with unknown node id currently throws (known robustness gap)', () => {
|
||||
test('registerChild with unknown node id is ignored without throwing', () => {
|
||||
const inst = Object.create(NodeClass.prototype);
|
||||
const node = makeNodeStub();
|
||||
|
||||
@@ -18,7 +18,7 @@ test('registerChild with unknown node id currently throws (known robustness gap)
|
||||
|
||||
inst._attachInputHandler();
|
||||
|
||||
assert.throws(() => {
|
||||
assert.doesNotThrow(() => {
|
||||
node._handlers.input(
|
||||
{ topic: 'registerChild', payload: 'missing-child', positionVsParent: 'upstream' },
|
||||
() => {},
|
||||
|
||||
@@ -4,12 +4,13 @@ const assert = require('node:assert/strict');
|
||||
const { Reactor_PFR } = require('../../src/specificClass');
|
||||
const { makeReactorConfig } = require('../helpers/factories');
|
||||
|
||||
test('oxygen measurement at exact reactor length overflows PFR grid index (known bounds gap)', () => {
|
||||
test('oxygen measurement at exact reactor length is clamped to the last PFR grid index', () => {
|
||||
const reactor = new Reactor_PFR(
|
||||
makeReactorConfig({ reactor_type: 'PFR', length: 10, resolution_L: 5, n_inlets: 1 }),
|
||||
);
|
||||
|
||||
assert.throws(() => {
|
||||
assert.doesNotThrow(() => {
|
||||
reactor._updateMeasurement('quantity (oxygen)', 2.5, 10, {});
|
||||
});
|
||||
assert.equal(reactor.state[reactor.n_x - 1][0], 2.5);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user