Compare commits

...

2 Commits

Author SHA1 Message Date
celestial-vault fd222fb182 changeset 2025-04-08 13:40:00 -07:00
celestial-vault 51cfdb476a unblock apioptions spec errors 2025-04-08 13:39:40 -07:00
2 changed files with 11 additions and 4 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"claude-dev": patch
---
TS errors
@@ -6,7 +6,7 @@ import { ExtensionStateContextProvider } from "@/context/ExtensionStateContext"
vi.mock("../../../context/ExtensionStateContext", async (importOriginal) => {
const actual = await importOriginal()
return {
...actual,
...(actual || {}),
// your mocked methods
useExtensionState: vi.fn(() => ({
apiConfiguration: {
@@ -25,6 +25,7 @@ describe("ApiOptions Component", () => {
const mockPostMessage = vi.fn()
beforeEach(() => {
//@ts-expect-error - vscode is not defined in the global namespace in test environment
global.vscode = { postMessage: mockPostMessage } as any
})
@@ -52,7 +53,7 @@ describe("ApiOptions Component", () => {
vi.mock("../../../context/ExtensionStateContext", async (importOriginal) => {
const actual = await importOriginal()
return {
...actual,
...(actual || {}),
// your mocked methods
useExtensionState: vi.fn(() => ({
apiConfiguration: {
@@ -71,6 +72,7 @@ describe("ApiOptions Component", () => {
const mockPostMessage = vi.fn()
beforeEach(() => {
//@ts-expect-error - vscode is not defined in the global namespace in test environment
global.vscode = { postMessage: mockPostMessage } as any
})
@@ -98,8 +100,7 @@ describe("ApiOptions Component", () => {
vi.mock("../../../context/ExtensionStateContext", async (importOriginal) => {
const actual = await importOriginal()
return {
...actual,
// your mocked methods
...(actual || {}),
useExtensionState: vi.fn(() => ({
apiConfiguration: {
apiProvider: "openai",
@@ -117,6 +118,7 @@ describe("OpenApiInfoOptions", () => {
beforeEach(() => {
vi.clearAllMocks()
//@ts-expect-error - vscode is not defined in the global namespace in test environment
global.vscode = { postMessage: mockPostMessage }
})