Skip to content

Test Cases

🕙 Start time⌛ Duration
10/23/2025, 8:27:31 AM15.164 s
✅ Passed❌ Failed⏩ Skipped🚧 Todo⚪ Total
Test Suites140000140
Tests394000394

tests/actionDictionary.test.ts

69 passed, 0 failed, 0 skipped, 0 todo, done in 256.24800999999934 s

✅ actionDictionary › constructor
   ✅ returns an instance of ActionDictionaryTest
   ✅ returns an instance of AbstractBaseClass
   ✅ has an autogenerated alphanumeric Correlation ID
   ✅ is empty by default
✅ actionDictionary › /setActionValidator
   ✅ accepts a function to overwrite default Action Validator
   ✅ resets the Action Validator to default when called with null
   ✅ returns self
✅ actionDictionary › /getDictionary
   ✅ returns the dictionary
   ✅ filters by namespace
   ✅ ignores invalid namespaces
✅ actionDictionary › /clearActions › when used with no arguments
   ✅ returns self
   ✅ wipes the dictionary
✅ actionDictionary › /clearActions › when used with a namespace
   ✅ returns self
   ✅ removes the particular namespace
   ✅ ignores invalid namespaces
✅ actionDictionary › /clearActions
✅ actionDictionary › /getActionValues › returns null when namespace and/or action does not match
   ✅ action from different namespace
   ✅ action from non-existent namespace
   ✅ action in default namespace that does not exist
   ✅ returns as many nulls as keys were requested
✅ actionDictionary › /getActionValues
   ✅ returns empty array for empty input
   ✅ returns a valid Action value without namespace
   ✅ returns a valid Action with namespace
   ✅ is idempotent
✅ actionDictionary › /addActions › without namespace
   ✅ returns valid numeric values
   ✅ is idempotent
   ✅ throws when adding duplicate keys
✅ actionDictionary › /addActions › with namespace
   ✅ returns valid numeric values
   ✅ is idempotent
   ✅ allows adding same keys with different namespaces
   ✅ throws when adding duplicate keys
✅ actionDictionary › /addActions
✅ actionDictionary › /removeActions › with namespace › without Keys and Actions
   ✅ does not change the dictionary with non-existing namespace
   ✅ does not change the dictionary with existing namespace
✅ actionDictionary › /removeActions › with namespace › with Keys
   ✅ does not change the dictionary with non-existing namespace
   ✅ ignores empty keys
   ✅ ignores keys from different namespace
   ✅ ignores non-existing keys
   ✅ removes the requested Keys
✅ actionDictionary › /removeActions › with namespace › with Actions
   ✅ does not change the dictionary with non-existing namespace
   ✅ ignores empty actions
   ✅ ignores actions from different namespace
   ✅ ignores non-existing actions
   ✅ removes the requested Actions
✅ actionDictionary › /removeActions › with namespace › with Keys and Actions
   ✅ does not change the dictionary with non-existing namespace
   ✅ ignores empty actions and keys
   ✅ removes the requested Actions and Keys
   ✅ restricts removed Actions and Keys to the requested namespace
✅ actionDictionary › /removeActions › with namespace
✅ actionDictionary › /removeActions › without namespace › without Keys and Actions
   ✅ does not change the dictionary
✅ actionDictionary › /removeActions › without namespace › with Keys
   ✅ ignores empty keys
   ✅ ignores non-existing keys
   ✅ removes the requested Keys
✅ actionDictionary › /removeActions › without namespace › with Actions
   ✅ ignores empty actions
   ✅ ignores Actions from namespaces
   ✅ ignores non-existent Actions
   ✅ removes the requested Actions
✅ actionDictionary › /removeActions › without namespace › with Keys and Actions
   ✅ ignores empty actions and keys
   ✅ removes the requested Actions and Keys
   ✅ restricts removed Actions and Keys to the default namespace
✅ actionDictionary › /removeActions › without namespace
✅ actionDictionary › /removeActions
   ✅ returns self
   ✅ does not change the dictionary without params
   ✅ on empty dictionary does not change anything
✅ actionDictionary › /getActionKeys › returns null when namespace and/or action does not match
   ✅ invalid action
   ✅ actions from different namespace
   ✅ action from non-existent namespace
   ✅ action in default namespace that does not exist
   ✅ returns as many nulls as keys were requested
✅ actionDictionary › /getActionKeys
   ✅ returns empty array for empty input
   ✅ is idempotent
   ✅ returns a key without namespace
   ✅ returns a key with namespace
✅ actionDictionary

tests/automata.test.ts

68 passed, 0 failed, 0 skipped, 0 todo, done in 203.1859829999994 s

✅ automata › constructor
   ✅ returns an instance of AutomataTest
   ✅ returns an instance of AbstractBaseClass
   ✅ sets the EventAdapter
✅ automata › /setEventValidator
   ✅ accepts a function to overwrite default Event Validator
   ✅ resets the Event Validator to default when called with null
   ✅ returns self
✅ automata › /setActionValidator
   ✅ accepts a function to overwrite default Action Validator
   ✅ resets the Action Validator to default when called with null
   ✅ returns self
✅ automata › /setStateValidator
   ✅ accepts a function to overwrite default State Validator
   ✅ resets the State Validator to default when called with null
   ✅ returns self
✅ automata › when not initialized properly
   ✅ throws an error when calling `dispatch`
   ✅ throws an error when calling `consumeAction`
   ✅ throws an error when calling `collapseActionQueue`
✅ automata › /init
   ✅ resets root reducer when called with null as reducer
   ✅ throws when called with non-function reducer
   ✅ assigns a reducer when passed
   ✅ initializes with provided Context, empty Queue, and is Enabled and Resumed by default
   ✅ resets the Queue and Internal State, while copying Disabled and Paused, when invoked upon stateful Automata
   ✅ throws when called with invalid state
   ✅ returns self
✅ automata › /consumeAction › with argument
   ✅ pops all Actions from Action Queue and returns computed Context, when called with number greater than queue length
   ✅ when Disabled, computes the specified quantity of Actions from the Queue without changing the internal state
   ✅ when Enabled, consumes of Actions from the Queue and changes the state
✅ automata › /consumeAction
   ✅ with empty Action Queue returns the current Context 
   ✅ with empty Action Queue returns the current Context when called with parameter 
   ✅ when Disabled, doesn't alter the Action Queue but returns computed Context
   ✅ when Enabled, pops the Action Queue and returns computed Context
✅ automata › /dispatch › when Unpaused, Enabled
   ✅ instantly updates internal Context without the Action Queue and returns new Context
   ✅ doesn't Disable or Pause
✅ automata › /dispatch › when Unpaused, Disabled
   ✅ returns new Context without altering Action Queue or changing internal Context
   ✅ doesn't Enable or Pause
✅ automata › /dispatch › when Paused, Enabled
   ✅ returns new Context, adding Action to Action Queue and not changing internal Context
   ✅ doesn't Disable or Resume
✅ automata › /dispatch › when Paused, Disabled
   ✅ returns new Context, adding Action to Action Queue and not changing internal Context
   ✅ doesn't Enable or Resume
✅ automata › /dispatch
   ✅ throws on invalid Actions
   ✅ is pure function
✅ automata › /pause, /resume, /disable, /enable › when Paused › enabling/Disabling in Paused mode
   ✅ disable is invariant to Paused and Context, but not to Action Queue
   ✅ enable is invariant to Paused, and Context, but not to Action Queue
   ✅ disable(true) clears the Action Queue but invariant to Context and Paused
✅ automata › /pause, /resume, /disable, /enable › when Paused
   ✅ resumes the Disabled Automata, preserving the queue
   ✅ resumes the Enabled Automata, Consuming the queue
   ✅ pause is idempotent
   ✅ does not Dispatch the Action but queues it
✅ automata › /pause, /resume, /disable, /enable › when not Paused › enabling/Disabling not in Paused mode
   ✅ disable is invariant to Action Queue, Context and Paused
   ✅ disable with 'true' is invariant to Action Queue, Context and Paused
   ✅ enable is invariant to Paused and Action Queue, but not to Context
✅ automata › /pause, /resume, /disable, /enable › when not Paused
   ✅ pauses the enabled Automata
   ✅ pauses the disabled Automata
   ✅ resume is idempotent
✅ automata › /pause, /resume, /disable, /enable
✅ automata › /getActionQueue
   ✅ returns the Action Queue when Paused
   ✅ is always empty when Resumed and Enabled
   ✅ every call returns a new object
✅ automata › /getContext
   ✅ returns the Context passed at initialization
   ✅ every call returns a new object
✅ automata › /getReducer
   ✅ returns the RootReducer passed at initialization
   ✅ returns Null when RootReducer is reset
✅ automata › /clearActionQueue
   ✅ clears the Action Queue when Paused, Enabled
   ✅ clears the Action Queue when Paused, Disabled
   ✅ isn't needed when Resumed, Enabled
   ✅ isn't needed when Resumed, Disabled
   ✅ returns self
✅ automata › /collapseActionQueue › when Paused
   ✅ when Enabled, clears the Action Queue and returns it along with new Context
   ✅ when Disabled, returns the Action Queue and Context, but doesn't change them
✅ automata › /collapseActionQueue › when Resumed
   ✅ when Enabled, does not change anything, returns the current Context and empty Actions
   ✅ when Disabled, returns the Action Queue and Context, but doesn't change them
✅ automata › /collapseActionQueue
✅ automata

tests/coreLoop.test.ts

6 passed, 0 failed, 0 skipped, 0 todo, done in 131.56553699999995 s

✅ coreLoop unit tests (with stubbed Automata)
   ✅ start/stop toggles EventBus running flag and is idempotent
   ✅ registers and unregisters Automata; duplicate ids throw; basic wiring works with stub
   ✅ registers/unregisters Sources with explicit ids and respects start/stop lifecycle
   ✅ registers/unregisters Destinations and unsubscribes handlers on unregister/stop
   ✅ unregisterAutomata is safe to call twice
   ✅ rejects registering sources/destinations without non-empty ids

tests/dataDestination.test.ts

39 passed, 0 failed, 0 skipped, 0 todo, done in 125.30718899999965 s

✅ dataDestination › constructor
   ✅ should initialize with the correct id
   ✅ should call afterInit with correct arguments
   ✅ should match instance id with passed id
   ✅ should throw when passed invalid resolver
   ✅ has proper starting values
✅ dataDestination › /start, /stop
   ✅ should be disabled by default
   ✅ should be enabled when started and increase epoch
   ✅ should be disabled when stopped
   ✅ should reset cycles and increment epoch when started, while keeping total cycles
   ✅ should resolve all packets sent before start
✅ dataDestination › /send
   ✅ should resolve with correct value when send is called
   ✅ should increment cycles after resolver completes
   ✅ should throw an error if resolver is not set
   ✅ should throw an error if resolver is not provided
   ✅ should increment cycles and epochs correctly
   ✅ should resolve with null when disabled
✅ dataDestination › /requestEmitter
   ✅ should return null when created and not started
   ✅ should return null when created, started
   ✅ should return the result of resolver after send has been dispatched
   ✅ should return null after send when stopped
   ✅ should return the error thrown by resolver after send has been dispatched
✅ dataDestination › /getBoundEvents
   ✅ should return an empty array by default
   ✅ should return bound events after triggers are added
   ✅ returns each key only once
   ✅ returns an array containing null when instance have wildcard listeners attached
✅ dataDestination › triggers
   ✅ createTrigger returns the instance
   ✅ createTrigger throws an error if passed an invalid argument
   ✅ removeTrigger returns the instance
   ✅ removeTrigger throws an error if passed an invalid argument
   ✅ removeTrigger removes a specific selector
   ✅ getTriggers returns the triggers without duplicates
✅ dataDestination › update
   ✅ calls the passed selector when event is sent
   ✅ returns correct values when the same event has two different selectors
   ✅ does not call the passed selector when event is not bound
   ✅ calls the resolver with the selector result when a bound event is sent
   ✅ returns null and doesn't call selector and/or resolver when the instance is disabled
   ✅ throws an error when passed an invalid event
   ✅ calls the selector and resolver for every sent event when a wildcard trigger is used
   ✅ calls multiple selectors and resolver for every sent event when a wildcard and a specific trigger is used
✅ dataDestination

tests/dataSource.test.ts

32 passed, 0 failed, 0 skipped, 0 todo, done in 1216.8322 s

✅ basicDataSource › constructor
   ✅ passes a fixture id
   ✅ has proper starting values
   ✅ returns an instance of BasicDataSource
   ✅ inherits passed id
   ✅ has an id when created without a parameter
   ✅ instance is disabled by default
   ✅ calls afterInit synchronously
   ✅ passes a clear function to afterInit
   ✅ passes a setterLink to afterInit
✅ basicDataSource › /start, /stop
   ✅ start increases epoch and resets cycles
   ✅ start/stop should change isActive
✅ basicDataSource › /dataEmitter, /eventEmitter
   ✅ doesn't emit a packet when disabled
   ✅ emits a preset packet
   ✅ emits a custom packet immediately
   ✅ emits a sequence of packets
   ✅ does not emit received packet when disabled
   ✅ can be cleared
   ✅ increments cycles and sagas accordingly
   ✅ dataEmitter and eventEmitter consume packets in order and leave no packets for the other
   ✅ dataEmitter returns null with no data in queue
   ✅ eventEmitter returns empty array with no data in queue
   ✅ dataEmitter throws when provided with mapper that returns malformed packet
   ✅ eventEmitter throws when provided with mapper that returns malformed packet
   ✅ invokes listener and dispatch functions when dataEmitter is consumed
   ✅ invokes listener and dispatch functions with multiple packets
✅ basicDataSource › /addListener, /removeListener
   ✅ can add a listener
   ✅ can remove a listener
   ✅ throws when adding a non-function listener
   ✅ throws when adding a non-function dispatch
✅ basicDataSource › multiple listeners cases
   ✅ invokes all listeners with dispatch when consuming dataemitter
   ✅ consuming event emitter invokes all listeners and returns mapped events
   ✅ getEventListeners returns all registered listeners according to their ids
✅ basicDataSource

tests/eventAdapter.test.ts

46 passed, 0 failed, 0 skipped, 0 todo, done in 103.92185800000016 s

✅ eventAdapter › constructor
   ✅ returns an instance of EventAdapterTest
   ✅ returns an instance of AbstractBaseClass
   ✅ has an autogenerated alphanumeric Correlation ID
   ✅ is empty by default
✅ eventAdapter › setEventValidator
   ✅ accepts a function to overwrite default Event Validator
   ✅ resets the Event Validator to default when called with null
✅ eventAdapter › setStateValidator
   ✅ accepts a function to overwrite default State Validator
   ✅ resets the Event Validator to default when called with null
✅ eventAdapter › getObservedEvents
   ✅ returns an empty array by default
   ✅ returns observed events
   ✅ omits Events that are discarded by Event Validator
✅ eventAdapter › getObservedStates
   ✅ returns an empty array by default
   ✅ returns observed states
   ✅ omits States that are discarded by State Validator
✅ eventAdapter › event Handling › addEventListener
   ✅ actually adds an observer
   ✅ returns an unsubscribe function
   ✅ returns Null when called with invalid handler
   ✅ ignores invalid Events and returns Null
   ✅ ignores listeners for Events that are discarded by Event Validator
✅ eventAdapter › event Handling › handleEvent (single listener)
   ✅ ignores invalid Events
   ✅ ignores Events discarded by Event Validator
   ✅ correctly handles single event
   ✅ is pure function
   ✅ is correctly applied with null EventMeta
✅ eventAdapter › event Handling › handleEvent (multiple listeners)
   ✅ returns a related stack of actions on success
   ✅ applies multiple event handlers to each event in original order
✅ eventAdapter › event Handling › removeAllListeners
   ✅ removes all listeners without an argument
   ✅ removes typed listeners with a typed argument
   ✅ ignores invalid Events
   ✅ ignores Events discarded by Event Validator
✅ eventAdapter › event Handling
✅ eventAdapter › event Dispatching › addEventEmitter
   ✅ actually adds an emitter
   ✅ returns an unsubscribe function
   ✅ returns Null when called with invalid Emitter
   ✅ ignores invalid States and returns Null
   ✅ ignores Emitters for States that are discarded by State Validator
✅ eventAdapter › event Dispatching › handleTransition (single emitter)
   ✅ ignores invalid States
   ✅ ignores States discarded by State Validator
   ✅ correctly handles a single transition
   ✅ is pure function
   ✅ is correctly applied with null state context
✅ eventAdapter › event Dispatching › handleTransition (multiple emitters)
   ✅ returns a related stack of actions on success
   ✅ applies multiple event handlers to each event in original order
✅ eventAdapter › event Dispatching › removeAllEmitters
   ✅ removes all listeners without an argument
   ✅ removes emitters for a specific state when called with a typed argument
   ✅ ignores invalid States
   ✅ ignores States discarded by State Validator
✅ eventAdapter › event Dispatching
✅ eventAdapter

tests/eventBus.test.ts

23 passed, 0 failed, 0 skipped, 0 todo, done in 292.2833680000001 s

✅ eventBus › constructor
   ✅ returns an instance of EventBusTest
   ✅ returns an instance of AbstractBaseClass
   ✅ has an autogenerated alphanumeric Correlation ID
   ✅ is empty by default
✅ eventBus › /subscribe
   ✅ returns self
   ✅ throws when provided invalid event
   ✅ throws when provided invalid handler
   ✅ when the same handler added twice, it's called only once
   ✅ when handler returns result:null, events are processed synchronously
   ✅ when handler returns result as Promise, it gets into queue
   ✅ when handler returns result as Promise, pausing and resuming after dispatching works as expected
   ✅ all events returned by handlers are added to the queue as one batch during processing cycle
✅ eventBus › /unsubscribe
   ✅ throws when provided invalid event
   ✅ removes a specific handler
   ✅ ignores non-existent handler
   ✅ removes all handlers for given event if passed null
✅ eventBus › /resume, /pause
   ✅ affects isRunning status
   ✅ /resume consumes all events in queue
✅ eventBus › /getEventStack
   ✅ events are added to event stack
   ✅ event stack can be cleared
✅ eventBus › /dispatch
   ✅ can process events synchronously
   ✅ does not process events if paused
   ✅ there is no race condition when events are dispatched both directly and from handler
✅ eventBus

tests/eventDictionary.test.ts

69 passed, 0 failed, 0 skipped, 0 todo, done in 246.18163400000049 s

✅ eventDictionary › constructor
   ✅ returns an instance of EventDictionaryTest
   ✅ returns an instance of AbstractBaseClass
   ✅ has an autogenerated alphanumeric Correlation ID
   ✅ is empty by default
✅ eventDictionary › /setEventValidator
   ✅ accepts a function to overwrite default Event Validator
   ✅ resets the Event Validator to default when called with null
   ✅ returns self
✅ eventDictionary › /getDictionary
   ✅ returns the dictionary
   ✅ filters by namespace
   ✅ ignores invalid namespaces
✅ eventDictionary › /clearEvents › when used with no arguments
   ✅ returns self
   ✅ wipes the dictionary
✅ eventDictionary › /clearEvents › when used with a namespace
   ✅ returns self
   ✅ removes the particular namespace
   ✅ ignores invalid namespaces
✅ eventDictionary › /clearEvents
✅ eventDictionary › /getEventValues › returns null when namespace and/or Event does not match
   ✅ event from different namespace
   ✅ event from non-existent namespace
   ✅ event in default namespace that does not exist
   ✅ returns as many nulls as keys were requested
✅ eventDictionary › /getEventValues
   ✅ returns empty array for empty input
   ✅ returns a valid Event value without namespace
   ✅ returns a valid Event with namespace
   ✅ is idempotent
✅ eventDictionary › /addEvents › without namespace
   ✅ returns valid numeric values
   ✅ is idempotent
   ✅ throws when adding duplicate keys
✅ eventDictionary › /addEvents › with namespace
   ✅ returns valid numeric values
   ✅ is idempotent
   ✅ allows adding same keys with different namespaces
   ✅ throws when adding duplicate keys
✅ eventDictionary › /addEvents
✅ eventDictionary › /removeEvents › with namespace › without Keys and Events
   ✅ does not change the dictionary with non-existing namespace
   ✅ does not change the dictionary with existing namespace
✅ eventDictionary › /removeEvents › with namespace › with Keys
   ✅ does not change the dictionary with non-existing namespace
   ✅ ignores empty keys
   ✅ ignores keys from different namespace
   ✅ ignores non-existing keys
   ✅ removes the requested Keys
✅ eventDictionary › /removeEvents › with namespace › with Events
   ✅ does not change the dictionary with non-existing namespace
   ✅ ignores empty Events
   ✅ ignores Events from different namespace
   ✅ ignores non-existing Events
   ✅ removes the requested Events
✅ eventDictionary › /removeEvents › with namespace › with Keys and Events
   ✅ does not change the dictionary with non-existing namespace
   ✅ ignores empty Events and keys
   ✅ removes the requested Events and Keys
   ✅ restricts removed Events and Keys to the requested namespace
✅ eventDictionary › /removeEvents › with namespace
✅ eventDictionary › /removeEvents › without namespace › without Keys and Events
   ✅ does not change the dictionary
✅ eventDictionary › /removeEvents › without namespace › with Keys
   ✅ ignores empty keys
   ✅ ignores non-existing keys
   ✅ removes the requested Keys
✅ eventDictionary › /removeEvents › without namespace › with Events
   ✅ ignores empty Events
   ✅ ignores Events from namespaces
   ✅ ignores non-existent Events
   ✅ removes the requested Events
✅ eventDictionary › /removeEvents › without namespace › with Keys and Events
   ✅ ignores empty Events and keys
   ✅ removes the requested Events and Keys
   ✅ restricts removed Events and Keys to the default namespace
✅ eventDictionary › /removeEvents › without namespace
✅ eventDictionary › /removeEvents
   ✅ returns self
   ✅ does not change the dictionary without params
   ✅ on empty dictionary does not change anything
✅ eventDictionary › /getEventKeys › returns null when namespace and/or Event does not match
   ✅ invalid Event
   ✅ events from different namespace
   ✅ event from non-existent namespace
   ✅ event in default namespace that does not exist
   ✅ returns as many nulls as keys were requested
✅ eventDictionary › /getEventKeys
   ✅ returns empty array for empty input
   ✅ is idempotent
   ✅ returns a key without namespace
   ✅ returns a key with namespace
✅ eventDictionary

tests/functionDictionary.test.ts

8 passed, 0 failed, 0 skipped, 0 todo, done in 13.04253099999994 s

✅ functionDictionary › /register
   ✅ should register single function
   ✅ should register multiple functions
   ✅ should throw on invalid function key
   ✅ should throw on duplicate registration
✅ functionDictionary › /get
   ✅ should return registered function
   ✅ should throw if function not found
✅ functionDictionary › /call
   ✅ should call registered function
✅ functionDictionary › /clear
   ✅ should clear all functions
✅ functionDictionary

tests/stateDictionary.test.ts

34 passed, 0 failed, 0 skipped, 0 todo, done in 46.67572199999995 s

✅ stateDictionary › constructor
   ✅ returns an instance of StateDictionaryTest
   ✅ returns an instance of AbstractBaseClass
   ✅ has an autogenerated alphanumeric Correlation ID
   ✅ is empty by default
✅ stateDictionary › /getStateKeys
   ✅ returns empty array for empty input
   ✅ returns state keys with matching namespace
✅ stateDictionary › /clearStates
   ✅ returns self
   ✅ clears all states and leaves dictionary empty
✅ stateDictionary › /removeStates
   ✅ returns self
   ✅ removes single state by key
   ✅ removes multiple states by key
   ✅ does not remove non-existing states
   ✅ removes associated contextTransformers
✅ stateDictionary › /getStateValues
   ✅ returns empty array for empty input
   ✅ returns single state by key
   ✅ returns multiple states by key
   ✅ does not return non-existing states
✅ stateDictionary › /addStates
   ✅ returns array of states
   ✅ adds a single state
   ✅ adds multiple states
   ✅ throws on duplicate states
   ✅ handles undefined keys gracefully
   ✅ adds states with namespace
✅ stateDictionary › /addContextTransformer
   ✅ adds transformer
   ✅ throws on duplicate transformers
   ✅ adds transformer with namespace
✅ stateDictionary › /removeContextTransformer
   ✅ removes transformer
   ✅ gracefully handles non-existing transformer
   ✅ removes transformer with namespace
✅ stateDictionary › /removeContextTransformerById
   ✅ removes transformer by id
   ✅ gracefully handles non-existing id
   ✅ removes transformer by id with namespace
✅ stateDictionary › /runContextTransformers
   ✅ runs transformer when passed corresponding states
   ✅ does not run transformer when passed different state
✅ stateDictionary