fix(confidence-engine): expose failed provider path
This commit is contained in:
@@ -112,6 +112,22 @@ describe("normaliseAnalysisResponse", () => {
|
||||
});
|
||||
|
||||
describe("analyseScenario compatibility", () => {
|
||||
it("preserves an attempted provider API path on provider failure", async () => {
|
||||
const providerError = new Error("Provider failed");
|
||||
providerError.providerApiPath = "/api/chat";
|
||||
mockGenerateReconstruction.mockRejectedValue(providerError);
|
||||
|
||||
const { analyseScenario } = await import("@/lib/analysis.js");
|
||||
const result = await analyseScenario("Scenario text", {
|
||||
promptVersion: "v0.3",
|
||||
});
|
||||
|
||||
expect(result).toMatchObject({
|
||||
success: false,
|
||||
providerApiPath: "/api/chat",
|
||||
});
|
||||
});
|
||||
|
||||
it("succeeds when the only mismatch is null evidence source", async () => {
|
||||
mockGenerateReconstruction.mockResolvedValue({
|
||||
inputClassification: {
|
||||
|
||||
Reference in New Issue
Block a user