Skip to content

Add unit tests for confidence scoring module #34

Description

@manthan787

Description

Improve test coverage for the confidence scoring module in src/agent/confidence.ts.

Why

The confidence scoring module is critical for investigation quality but currently has limited test coverage. Adding tests helps ensure reliability and makes future changes safer.

What to do

  1. Look at src/agent/confidence.ts to understand the confidence calculation logic
  2. Create or extend src/agent/__tests__/confidence.test.ts
  3. Add test cases for:
    • Edge cases (0%, 100% confidence)
    • Multiple evidence sources
    • Conflicting evidence handling
    • Confidence threshold behavior

Example test structure

import { describe, test, expect } from "bun:test";
import { calculateConfidence } from "../confidence";

describe("confidence scoring", () => {
  test("returns 0 with no evidence", () => {
    // ...
  });
  
  test("increases confidence with supporting evidence", () => {
    // ...
  });
});

Getting Started

bun install
bun test src/agent/__tests__/confidence.test.ts

Great for learning the testing patterns in this project!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions