@mantaq/test 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.d.mts +6 -6
  2. package/package.json +3 -3
package/dist/index.d.mts CHANGED
@@ -26,8 +26,8 @@ interface CoverageReport {
26
26
  effects: number;
27
27
  };
28
28
  }
29
- interface TestHarness {
30
- actor: AnyActor;
29
+ interface TestHarness<C = Record<string, unknown>> {
30
+ actor: AnyActor<C>;
31
31
  graph: ActorGraph;
32
32
  history: History;
33
33
  coverage: () => CoverageReport;
@@ -36,8 +36,8 @@ interface TestHarness {
36
36
  payload?: unknown;
37
37
  }): void;
38
38
  state: AnyActor["state"];
39
- snapshot(): Snapshot;
40
- context: Record<string, unknown> | undefined;
39
+ snapshot(): Snapshot<C>;
40
+ context: C | undefined;
41
41
  assertAllStatesVisited(): void;
42
42
  assertAllTransitionsVisited(): void;
43
43
  assertStateVisited(stateName: string): void;
@@ -56,7 +56,7 @@ interface TestHarness {
56
56
  }
57
57
  //#endregion
58
58
  //#region src/harness.d.ts
59
- declare function createTestHarness(actor: AnyActor): TestHarness;
59
+ declare function createTestHarness<C>(actor: AnyActor<C>): TestHarness<C>;
60
60
  //#endregion
61
61
  //#region src/coverage.d.ts
62
62
  declare function computeCoverage(graph: ActorGraph, history: History): CoverageReport;
@@ -68,7 +68,7 @@ declare function assertStateVisited(history: History, stateName: string): void;
68
68
  declare function assertStateNeverVisited(history: History, stateName: string): void;
69
69
  declare function assertTransitionVisited(history: History, from: string, event: string): void;
70
70
  declare function assertTransitionNeverVisited(history: History, from: string, event: string): void;
71
- declare function assertContextNever(actor: AnyActor, predicate: (context: unknown) => boolean): void;
71
+ declare function assertContextNever<C>(actor: AnyActor<C>, predicate: (context: unknown) => boolean): void;
72
72
  declare function assertEffectRan(history: History, stateName: string): void;
73
73
  declare function assertEffectNeverRan(history: History, stateName: string): void;
74
74
  declare function assertReachedState(history: History, stateName: string): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mantaq/test",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Test harness and assertion utilities for verifying mantaq actor behavior.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -20,8 +20,8 @@
20
20
  "access": "public"
21
21
  },
22
22
  "dependencies": {
23
- "@mantaq/core": "0.1.0",
24
- "@mantaq/traversal": "0.1.0"
23
+ "@mantaq/core": "0.2.0",
24
+ "@mantaq/traversal": "0.1.1"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/node": "^26.2.0",