@mantaq/test 0.0.1 → 0.1.0

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.
package/dist/index.d.mts CHANGED
@@ -32,8 +32,9 @@ interface TestHarness {
32
32
  history: History;
33
33
  coverage: () => CoverageReport;
34
34
  send(event: {
35
- id: string;
36
- } & Record<string, unknown>): void;
35
+ type: string;
36
+ payload?: unknown;
37
+ }): void;
37
38
  state: AnyActor["state"];
38
39
  snapshot(): Snapshot;
39
40
  context: Record<string, unknown> | undefined;
@@ -43,7 +44,7 @@ interface TestHarness {
43
44
  assertStateNeverVisited(stateName: string): void;
44
45
  assertTransitionVisited(from: string, event: string): void;
45
46
  assertTransitionNeverVisited(from: string, event: string): void;
46
- assertContextNever(predicate: (ctx: unknown) => boolean): void;
47
+ assertContextNever(predicate: (context: unknown) => boolean): void;
47
48
  assertEffectRan(stateName: string): void;
48
49
  assertEffectNeverRan(stateName: string): void;
49
50
  assertReachedState(stateName: string): void;
@@ -67,7 +68,7 @@ declare function assertStateVisited(history: History, stateName: string): void;
67
68
  declare function assertStateNeverVisited(history: History, stateName: string): void;
68
69
  declare function assertTransitionVisited(history: History, from: string, event: string): void;
69
70
  declare function assertTransitionNeverVisited(history: History, from: string, event: string): void;
70
- declare function assertContextNever(actor: AnyActor, predicate: (ctx: unknown) => boolean): void;
71
+ declare function assertContextNever(actor: AnyActor, predicate: (context: unknown) => boolean): void;
71
72
  declare function assertEffectRan(history: History, stateName: string): void;
72
73
  declare function assertEffectNeverRan(history: History, stateName: string): void;
73
74
  declare function assertReachedState(history: History, stateName: string): void;
package/dist/index.mjs CHANGED
@@ -88,8 +88,8 @@ function assertNeverReachedState(history, stateName) {
88
88
  //#region src/harness.ts
89
89
  function createTestHarness(actor) {
90
90
  const instrumented = instrument(actor);
91
- const internalIds = new Set((actor.options?.internal ?? []).map((e) => e.id));
92
- const graph = buildGraph(actor, { internalIds });
91
+ const internalTypes = new Set((actor.options?.internal ?? []).map((e) => e.type));
92
+ const graph = buildGraph(actor, { internalIds: internalTypes });
93
93
  return {
94
94
  actor: instrumented,
95
95
  graph,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mantaq/test",
3
- "version": "0.0.1",
3
+ "version": "0.1.0",
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.0.1",
24
- "@mantaq/traversal": "0.0.1"
23
+ "@mantaq/core": "0.1.0",
24
+ "@mantaq/traversal": "0.1.0"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/node": "^26.2.0",