Skip to content

@codesoul-co/hypha-testing / index

Using this module

Aggregates the public entrypoint exports for @codesoul-co/hypha-testing; applications import these symbols from the package entrypoint instead of internal file paths.

Import from the package entrypoint

ts
import {
  assertEventTypes,
  assertStatePath,
  collectEventTypes,
} from '@codesoul-co/hypha-testing';

import type {
  GoldenTraceFixture,
} from '@codesoul-co/hypha-testing';

Usage patterns

  • Use the 1 type/interface export as static contracts in application code, adapters, or tests. Import them with import type; they do not exist at runtime.
  • The module exposes 3 functions as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.

Public exports

SymbolKindSignatureDescription
assertEventTypesfunctionassertEventTypes(fixture: GoldenTraceFixture, expectedTypes: FrameworkEventType[]): booleanAssert Event Types function with 1 public call signature; parameters and return types are listed below.
assertStatePathfunctionassertStatePath(fixture: GoldenTraceFixture, expectedPath: string[]): booleanAssert State Path function with 1 public call signature; parameters and return types are listed below.
collectEventTypesfunctioncollectEventTypes(events: FrameworkEvent[]): FrameworkEventType[]Collect Event Types function with 1 public call signature; parameters and return types are listed below.
GoldenTraceFixtureinterfaceinterface GoldenTraceFixtureGolden Trace Fixture interface with 4 public fields or methods.

assertEventTypes

Assert Event Types function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { assertEventTypes } from '@codesoul-co/hypha-testing';
  • Source module: index

Declaration

text
export declare function assertEventTypes(fixture: GoldenTraceFixture, expectedTypes: FrameworkEventType[]): boolean;

Call signature

text
assertEventTypes(fixture: GoldenTraceFixture, expectedTypes: FrameworkEventType[]): boolean

Parameters

ParameterTypeRequiredDescription
fixtureGoldenTraceFixtureYesRequired parameter; accepted values are defined by the type column.
expectedTypesFrameworkEventType[]YesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: boolean
  • Description: The return contract is defined by the type shown above.

assertStatePath

Assert State Path function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { assertStatePath } from '@codesoul-co/hypha-testing';
  • Source module: index

Declaration

text
export declare function assertStatePath(fixture: GoldenTraceFixture, expectedPath: string[]): boolean;

Call signature

text
assertStatePath(fixture: GoldenTraceFixture, expectedPath: string[]): boolean

Parameters

ParameterTypeRequiredDescription
fixtureGoldenTraceFixtureYesRequired parameter; accepted values are defined by the type column.
expectedPathstring[]YesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: boolean
  • Description: The return contract is defined by the type shown above.

collectEventTypes

Collect Event Types function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { collectEventTypes } from '@codesoul-co/hypha-testing';
  • Source module: index

Declaration

text
export declare function collectEventTypes(events: FrameworkEvent[]): FrameworkEventType[];

Call signature

text
collectEventTypes(events: FrameworkEvent[]): FrameworkEventType[]

Parameters

ParameterTypeRequiredDescription
eventsFrameworkEvent<unknown>[]YesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: FrameworkEventType[]
  • Description: The return contract is defined by the type shown above.

GoldenTraceFixture

Golden Trace Fixture interface with 4 public fields or methods.

  • Kind: interface
  • Import: import type { GoldenTraceFixture } from '@codesoul-co/hypha-testing';
  • Source module: index

Declaration

text
export interface GoldenTraceFixture {
    id: string;
    version: string;
    events: FrameworkEvent[];
    statePath?: string[];
}

Contract members

MemberKindSignatureDescription
eventspropertyevents: FrameworkEvent<unknown>[]Public property; its type, readonly modifier and optionality are shown in the signature.
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
statePathpropertystatePath?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
versionpropertyversion: stringPublic property; its type, readonly modifier and optionality are shown in the signature.