refactor: roll mode

* chore: escalate stack trace to console

* refactor: event finding in roll

* docs: initial roll specification

* refactor: call to roll

* refactor: normalise index

* refactor: roll into next event

* refactor: hot reload on waiting to roll

* refactor: wait to roll next
This commit is contained in:
Carlos Valente
2024-08-04 21:34:01 +02:00
committed by GitHub
parent 3012d73285
commit da11ef64c2
21 changed files with 1093 additions and 982 deletions
@@ -3,7 +3,6 @@ import { SupportedEvent } from 'ontime-types';
import {
filterPlayable,
filterTimedEvents,
getLastEvent,
getLastNormal,
getNext,
@@ -300,24 +299,19 @@ describe('getLastEvent', () => {
});
});
describe('filter event', () => {
const eventA = { id: 'a', type: SupportedEvent.Event } as OntimeEvent;
const eventB = { id: 'b', skip: true, type: SupportedEvent.Event } as OntimeEvent;
const testRundown = [
eventA,
eventB,
{ id: 'c', type: SupportedEvent.Delay },
{ id: 'd', type: SupportedEvent.Block },
];
describe('filterPlayable()', () => {
test('should return an array with only playable events', () => {
const eventA = { id: 'a', type: SupportedEvent.Event } as OntimeEvent;
const eventB = { id: 'b', skip: true, type: SupportedEvent.Event } as OntimeEvent;
const testRundown = [
eventA,
eventB,
{ id: 'c', type: SupportedEvent.Delay },
{ id: 'd', type: SupportedEvent.Block },
];
test('filterPlayable', () => {
const result = filterPlayable(testRundown as unknown as OntimeRundown);
expect(result).toMatchObject([eventA]);
});
test('filterTimedEvents', () => {
const result = filterTimedEvents(testRundown as unknown as OntimeRundown);
expect(result).toMatchObject([eventA, eventB]);
});
});
});