Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"rimraf": "6.0.1",
"tsx": "4.22.4",
"turbo": "2.10.0",
"typescript": "5.9.3"
"typescript": "5.9.3",
"vitest": "4.1.9"
},
"lint-staged": {
"*.{js,jsx,ts,tsx,json,css,md}": [
Expand Down
4 changes: 4 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions src/api/providers/__tests__/complete-prompt-options.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { describe, it, expect } from "vitest"

import type { CompletePromptOptions } from "../../index"

describe("CompletePromptOptions", () => {
it("should allow abortSignal property", () => {
const controller = new AbortController()
const options: CompletePromptOptions = { abortSignal: controller.signal }
expect(options.abortSignal).toBe(controller.signal)
})

it("should allow timeoutMs property", () => {
const options: CompletePromptOptions = { timeoutMs: 5000 }
expect(options.timeoutMs).toBe(5000)
})

it("should allow both abortSignal and timeoutMs together", () => {
const controller = new AbortController()
const options: CompletePromptOptions = { abortSignal: controller.signal, timeoutMs: 10000 }
expect(options.abortSignal).toBe(controller.signal)
expect(options.timeoutMs).toBe(10000)
})

it("should allow empty options object", () => {
const options: CompletePromptOptions = {}
expect(options.abortSignal).toBeUndefined()
expect(options.timeoutMs).toBeUndefined()
})
})
Loading
Loading