updates to rotating machine struct

This commit is contained in:
znetsixe
2026-02-12 10:48:44 +01:00
parent c63701db38
commit 405be33626
15 changed files with 1978 additions and 7 deletions

View File

@@ -0,0 +1,22 @@
const test = require('node:test');
const assert = require('node:assert/strict');
const Machine = require('../../src/specificClass');
const { makeMachineConfig, makeStateConfig } = require('../helpers/factories');
test('execSequence startup reaches operational with zero transition times', async () => {
const machine = new Machine(makeMachineConfig(), makeStateConfig());
await machine.handleInput('parent', 'execSequence', 'startup');
assert.equal(machine.state.getCurrentState(), 'operational');
});
test('execMovement updates controller position in operational state', async () => {
const machine = new Machine(makeMachineConfig(), makeStateConfig({ state: { current: 'operational' } }));
await machine.handleInput('parent', 'execMovement', 10);
const pos = machine.state.getCurrentPosition();
assert.ok(pos >= 9.9 && pos <= 10);
});