Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions .fernignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@

README.md
changelog.md
tests/unit/types/SayHookAction.test.ts

# PRO-3057: Manually fixed incorrect type for exact field (was Record<string, unknown>, should be string | string[])
src/api/types/SayHookAction.ts
2 changes: 1 addition & 1 deletion src/api/types/SayHookAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ export interface SayHookAction {
*/
prompt?: Vapi.SayHookActionPrompt | undefined;
/** This is the message to say */
exact?: Record<string, unknown> | undefined;
exact?: string | string[] | undefined;
}
31 changes: 31 additions & 0 deletions tests/unit/types/SayHookAction.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import type { SayHookAction } from "../../../src/api/types/SayHookAction.js";

describe("SayHookAction", () => {
it("should accept a string for exact", () => {
const action: SayHookAction = {
exact: "Hello, how can I help you?",
};
expect(action.exact).toBe("Hello, how can I help you?");
});

it("should accept a string array for exact", () => {
const action: SayHookAction = {
exact: ["Hello!", "How can I help you?"],
};
expect(action.exact).toEqual(["Hello!", "How can I help you?"]);
});

it("should allow exact to be undefined", () => {
const action: SayHookAction = {};
expect(action.exact).toBeUndefined();
});

it("should allow both prompt and exact to be set", () => {
const action: SayHookAction = {
prompt: "Greet the user warmly",
exact: "Welcome!",
};
expect(action.prompt).toBe("Greet the user warmly");
expect(action.exact).toBe("Welcome!");
});
});
Loading