mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-24 16:02:55 +08:00
fix: tighten contract test regex patterns per review feedback
- tool-info-contract: match icon/title within the ToolInfo type definition specifically, not any occurrence in the file - data-provider-contract: match openFile: props.onOpenFile pattern instead of bare substring match
This commit is contained in:
@@ -24,6 +24,6 @@ describe("DataProvider props contract", () => {
|
||||
|
||||
it("openFile is exposed on the context return value", () => {
|
||||
const src = fs.readFileSync(DATA_CONTEXT_FILE, "utf-8")
|
||||
expect(src).toContain("openFile:")
|
||||
expect(src).toMatch(/openFile:\s*props\.onOpenFile/)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -18,9 +18,9 @@ const MESSAGE_PART_FILE = path.join(MONOREPO_ROOT, "packages/ui/src/components/m
|
||||
describe("getToolInfo() return shape contract", () => {
|
||||
it("getToolInfo still exports expected shape fields", () => {
|
||||
const src = fs.readFileSync(MESSAGE_PART_FILE, "utf-8")
|
||||
// ToolInfo type must still have these fields
|
||||
expect(src).toMatch(/icon\s*:/)
|
||||
expect(src).toMatch(/title\s*:/)
|
||||
// ToolInfo type definition must still have these fields
|
||||
expect(src).toMatch(/export type ToolInfo\s*=\s*\{[^}]*icon\s*:/s)
|
||||
expect(src).toMatch(/export type ToolInfo\s*=\s*\{[^}]*title\s*:/s)
|
||||
})
|
||||
|
||||
it("getToolInfo function is exported", () => {
|
||||
|
||||
Reference in New Issue
Block a user