v0.2.0: Git-native architecture (#1)
This commit was merged in pull request #1.
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
import { getNextStage, createInitialPipelineState, STAGE_ORDER } from "../types/pipeline.js";
|
||||
import { confidenceToLevel, shouldEscalate } from "../types/decisions.js";
|
||||
import { ESCALATION_TYPES } from "../types/escalation.js";
|
||||
import { parseSpecification } from "../types/specification.js";
|
||||
import { createClarifyQuestion } from "../types/clarify.js";
|
||||
import { DEFAULT_CI_CONFIG } from "../types/config.js";
|
||||
|
||||
describe("Type exports", () => {
|
||||
it("pipeline types are importable and functional", () => {
|
||||
expect(STAGE_ORDER).toHaveLength(7);
|
||||
expect(getNextStage("specify")).toBe("clarify");
|
||||
const state = createInitialPipelineState("/tmp/test");
|
||||
expect(state.current_stage).toBe("specify");
|
||||
});
|
||||
|
||||
it("decision types are importable and functional", () => {
|
||||
expect(confidenceToLevel(0.9)).toBe("high");
|
||||
expect(shouldEscalate(0.5, 0.6)).toBe(true);
|
||||
});
|
||||
|
||||
it("escalation types are importable and functional", () => {
|
||||
expect(Object.keys(ESCALATION_TYPES)).toHaveLength(5);
|
||||
});
|
||||
|
||||
it("specification parser is importable and functional", () => {
|
||||
const spec = parseSpecification("# Test\n## Objective\nBuild it.", "inline");
|
||||
expect(spec.title).toBe("Test");
|
||||
});
|
||||
|
||||
it("clarify question factory is importable and functional", () => {
|
||||
const q = createClarifyQuestion({
|
||||
question: "Test?",
|
||||
context: "Test",
|
||||
default_answer: "Yes",
|
||||
rationale: "Why not",
|
||||
impact: "low",
|
||||
category: "test",
|
||||
});
|
||||
expect(q.id).toMatch(/^Q-/);
|
||||
});
|
||||
|
||||
it("config defaults are importable", () => {
|
||||
expect(DEFAULT_CI_CONFIG.autonomy.level).toBe("full");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user