Skip to content

Commit 2968c8d

Browse files
authored
Fix API Options Types in Tests (RooCodeInc#3522)
1 parent c617d25 commit 2968c8d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

webview-ui/src/components/settings/__tests__/APIOptions.spec.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ describe("ApiOptions Component", () => {
120120
const mockPostMessage = vi.fn()
121121

122122
beforeEach(() => {
123-
global.vscode = { postMessage: mockPostMessage } as any
123+
//@ts-expect-error - vscode is not defined in the global namespace in test environment
124+
global.vscode = { postMessage: mockPostMessage }
124125
})
125126

126127
it("renders Fireworks API Key input", () => {
@@ -167,7 +168,7 @@ describe("ApiOptions Component", () => {
167168
vi.mock("../../../context/ExtensionStateContext", async (importOriginal) => {
168169
const actual = await importOriginal()
169170
return {
170-
...actual,
171+
...(actual || {}),
171172
// your mocked methods
172173
useExtensionState: vi.fn(() => ({
173174
apiConfiguration: {

0 commit comments

Comments
 (0)