Skip to content

Commit fb9b91e

Browse files
committed
chore: ensure test code is type-checked in packages/evals
1 parent 14a5b6f commit fb9b91e

File tree

7 files changed

+19
-14
lines changed

7 files changed

+19
-14
lines changed

packages/eval/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
},
3434
"scripts": {
3535
"prepublishOnly": "pnpm run build",
36-
"build": "tsc -p tsconfig.json",
36+
"build": "tsc -p tsconfig.build.json",
3737
"typecheck": "tsc -p tsconfig.json --noEmit",
3838
"test": "vitest run",
3939
"lint": "eslint src test"
@@ -48,4 +48,4 @@
4848
"dotenv": "^16.4.7",
4949
"yaml": "^2.7.0"
5050
}
51-
}
51+
}

packages/eval/test/agent/assertions.test.ts renamed to packages/eval/src/test/agent/assertions.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { mkdtemp, rm, writeFile } from "node:fs/promises";
22
import { tmpdir } from "node:os";
33
import path from "node:path";
44
import { afterEach, beforeEach, describe, expect, it } from "vitest";
5-
import { evaluateAssertions } from "../../src/agent/assertions.js";
6-
import type { AgentAssertion } from "../../src/agent/types.js";
5+
import { evaluateAssertions } from "../../agent/assertions.js";
6+
import type { AgentAssertion } from "../../agent/types.js";
77

88
let workspaceDir: string;
99

packages/eval/test/agent/feedback.test.ts renamed to packages/eval/src/test/agent/feedback.test.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, expect, it } from "vitest";
2-
import { DEFAULT_FEEDBACK_TOOL_CONFIG, parseFeedbackResult } from "../../src/agent/feedback.js";
3-
import type { FeedbackToolConfig } from "../../src/agent/types.js";
2+
import { DEFAULT_FEEDBACK_TOOL_CONFIG, parseFeedbackResult } from "../../agent/feedback.js";
3+
import type { FeedbackToolConfig } from "../../agent/types.js";
44

55
const customConfig: FeedbackToolConfig = {
66
name: "give_feedback",
@@ -50,10 +50,7 @@ describe("parseFeedbackResult", () => {
5050
});
5151

5252
it("skips non-numeric metric values instead of failing", () => {
53-
const result = parseFeedbackResult(
54-
{ feedback: "test", rating: "not a number" },
55-
customConfig,
56-
);
53+
const result = parseFeedbackResult({ feedback: "test", rating: "not a number" }, customConfig);
5754
expect(result).toEqual({ scores: {}, reasoning: "test" });
5855
});
5956

packages/eval/test/agent/metrics.test.ts renamed to packages/eval/src/test/agent/metrics.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { describe, expect, it } from "vitest";
2-
import { computeAgentEvalSummary } from "../../src/agent/metrics.js";
3-
import type { AgentScenarioResult } from "../../src/agent/types.js";
2+
import { computeAgentEvalSummary } from "../../agent/metrics.js";
3+
import type { AgentScenarioResult } from "../../agent/types.js";
44

55
function makeResult(overrides: Partial<AgentScenarioResult> = {}): AgentScenarioResult {
66
return {
7+
id: "1",
78
name: "test",
89
activated: true,
910
passed: true,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
summarizeCases,
66
toDeltaCases,
77
type RankedCase,
8-
} from "../src/index.js";
8+
} from "../index.js";
99

1010
const cases: RankedCase[] = [
1111
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, expect, it } from "vitest";
2-
import { computeRoundsToRightDoc } from "../src/runner.js";
2+
import { computeRoundsToRightDoc } from "../runner.js";
33

44
describe("computeRoundsToRightDoc", () => {
55
it("uses executed rounds when the expected chunk was found", () => {

packages/eval/tsconfig.build.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"noEmit": false
5+
},
6+
"exclude": ["node_modules", "src/test/**"]
7+
}

0 commit comments

Comments
 (0)