feat: wire all barrel exports, resolve conflicts, add 8 sub-path import tests
This commit is contained in:
77
test/exports.test.ts
Normal file
77
test/exports.test.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
import { describe, it, expect } from "vitest";
|
||||
|
||||
import { FlowGraph, typeCompat, CycleError, OperationNodeAttrs, Operation, GraphologyHostConfig, WorkflowReactiveRoot, topologicalOrder } from "../src/index.js";
|
||||
import { buildTypeEdges as buildTypeEdgesGraph } from "../src/graph/index.js";
|
||||
import { CallStatusEnum, NodeStatusEnum, EdgeTypeEnum, CallResultSchema, OperationEdgeAttrs, CallEdgeAttrs, TemplateEdgeAttrs, CallNodeAttrs } from "../src/schema/index.js";
|
||||
import { Sequential, Parallel, Conditional, Map } from "../src/component/index.js";
|
||||
import { ReactiveHostConfig } from "../src/host/index.js";
|
||||
import { WorkflowReactiveRoot as ReactiveRootFromReactive, computePreconditions, computeBlockedByFailure } from "../src/reactive/index.js";
|
||||
import { typeCompat as typeCompatAnalysis, buildTypeEdges, validateGraph, validateTemplate, topologicalOrder as topologicalOrderAnalysis, parallelGroups, criticalPath, reachableFrom } from "../src/analysis/index.js";
|
||||
import { FlowgraphError, ConstructionError, CycleError as CycleErrorFromError, InvalidTransitionError } from "../src/error/index.js";
|
||||
|
||||
describe("Sub-path imports", () => {
|
||||
it("@alkdev/flowgraph → all public types", () => {
|
||||
expect(FlowGraph).toBeDefined();
|
||||
expect(typeCompat).toBeDefined();
|
||||
expect(CycleError).toBeDefined();
|
||||
expect(OperationNodeAttrs).toBeDefined();
|
||||
expect(Operation).toBeDefined();
|
||||
expect(GraphologyHostConfig).toBeDefined();
|
||||
expect(WorkflowReactiveRoot).toBeDefined();
|
||||
expect(topologicalOrder).toBeDefined();
|
||||
});
|
||||
|
||||
it("@alkdev/flowgraph/graph → FlowGraph, FlowGraphOptions", () => {
|
||||
expect(FlowGraph).toBeDefined();
|
||||
expect(buildTypeEdgesGraph).toBeDefined();
|
||||
});
|
||||
|
||||
it("@alkdev/flowgraph/schema → all schemas, enums, types, CallResult", () => {
|
||||
expect(OperationNodeAttrs).toBeDefined();
|
||||
expect(CallNodeAttrs).toBeDefined();
|
||||
expect(OperationEdgeAttrs).toBeDefined();
|
||||
expect(CallEdgeAttrs).toBeDefined();
|
||||
expect(TemplateEdgeAttrs).toBeDefined();
|
||||
expect(CallResultSchema).toBeDefined();
|
||||
expect(CallStatusEnum).toBeDefined();
|
||||
expect(NodeStatusEnum).toBeDefined();
|
||||
expect(EdgeTypeEnum).toBeDefined();
|
||||
});
|
||||
|
||||
it("@alkdev/flowgraph/component → Operation, Sequential, Parallel, Conditional, Map", () => {
|
||||
expect(Operation).toBeDefined();
|
||||
expect(Sequential).toBeDefined();
|
||||
expect(Parallel).toBeDefined();
|
||||
expect(Conditional).toBeDefined();
|
||||
expect(Map).toBeDefined();
|
||||
});
|
||||
|
||||
it("@alkdev/flowgraph/host → GraphologyHostConfig, ReactiveHostConfig", () => {
|
||||
expect(GraphologyHostConfig).toBeDefined();
|
||||
expect(ReactiveHostConfig).toBeDefined();
|
||||
});
|
||||
|
||||
it("@alkdev/flowgraph/reactive → WorkflowReactiveRoot, EventLogProjection", () => {
|
||||
expect(ReactiveRootFromReactive).toBeDefined();
|
||||
expect(computePreconditions).toBeDefined();
|
||||
expect(computeBlockedByFailure).toBeDefined();
|
||||
});
|
||||
|
||||
it("@alkdev/flowgraph/analysis → typeCompat, buildTypeEdges, validateGraph, validateTemplate, topologicalOrder, parallelGroups, criticalPath, reachableFrom", () => {
|
||||
expect(typeCompatAnalysis).toBeDefined();
|
||||
expect(buildTypeEdges).toBeDefined();
|
||||
expect(validateGraph).toBeDefined();
|
||||
expect(validateTemplate).toBeDefined();
|
||||
expect(topologicalOrderAnalysis).toBeDefined();
|
||||
expect(parallelGroups).toBeDefined();
|
||||
expect(criticalPath).toBeDefined();
|
||||
expect(reachableFrom).toBeDefined();
|
||||
});
|
||||
|
||||
it("@alkdev/flowgraph/error → all error classes", () => {
|
||||
expect(FlowgraphError).toBeDefined();
|
||||
expect(ConstructionError).toBeDefined();
|
||||
expect(CycleErrorFromError).toBeDefined();
|
||||
expect(InvalidTransitionError).toBeDefined();
|
||||
});
|
||||
});
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
CycleError,
|
||||
InvalidTransitionError,
|
||||
} from "../../src/error/index.js";
|
||||
import type { CallStatus } from "../../src/error/index.js";
|
||||
import type { CallStatus } from "../../src/schema/enums.js";
|
||||
|
||||
describe("FlowGraph constructor", () => {
|
||||
it("creates an empty graph", () => {
|
||||
|
||||
Reference in New Issue
Block a user