mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-22 05:11:06 -05:00
Update tests
This commit is contained in:
@@ -12,7 +12,6 @@ const mockDispose = jest.fn()
|
|||||||
const mockWatcher = {
|
const mockWatcher = {
|
||||||
onDidCreate: mockOnDidCreate.mockReturnValue({ dispose: mockDispose }),
|
onDidCreate: mockOnDidCreate.mockReturnValue({ dispose: mockDispose }),
|
||||||
onDidDelete: mockOnDidDelete.mockReturnValue({ dispose: mockDispose }),
|
onDidDelete: mockOnDidDelete.mockReturnValue({ dispose: mockDispose }),
|
||||||
onDidChange: mockOnDidChange.mockReturnValue({ dispose: mockDispose }),
|
|
||||||
dispose: mockDispose
|
dispose: mockDispose
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,16 +85,6 @@ describe("WorkspaceTracker", () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should handle file change events", async () => {
|
|
||||||
const [[callback]] = mockOnDidChange.mock.calls
|
|
||||||
await callback({ fsPath: "/test/workspace/changed.ts" })
|
|
||||||
|
|
||||||
expect(mockProvider.postMessageToWebview).toHaveBeenCalledWith({
|
|
||||||
type: "workspaceUpdated",
|
|
||||||
filePaths: ["changed.ts"]
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
it("should handle directory paths correctly", async () => {
|
it("should handle directory paths correctly", async () => {
|
||||||
// Mock stat to return directory type
|
// Mock stat to return directory type
|
||||||
;(vscode.workspace.fs.stat as jest.Mock).mockResolvedValueOnce({ type: 2 }) // FileType.Directory = 2
|
;(vscode.workspace.fs.stat as jest.Mock).mockResolvedValueOnce({ type: 2 }) // FileType.Directory = 2
|
||||||
|
|||||||
Reference in New Issue
Block a user