mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
Tidy up the Cline class a bit (#3100)
* Tidy up the Cline class a bit * Clean up more comments
This commit is contained in:
parent
11ed7d7d46
commit
bf38b830b8
2 changed files with 522 additions and 441 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -424,7 +424,7 @@ describe("Cline", () => {
|
|||
jest.spyOn(cline as any, "getEnvironmentDetails").mockResolvedValue("")
|
||||
|
||||
// Mock loadContext to return unmodified content.
|
||||
jest.spyOn(cline as any, "loadContext").mockImplementation(async (content) => [content, ""])
|
||||
jest.spyOn(cline as any, "parseUserContent").mockImplementation(async (content) => [content, ""])
|
||||
|
||||
// Add test message to conversation history.
|
||||
cline.apiConversationHistory = [
|
||||
|
|
@ -577,11 +577,8 @@ describe("Cline", () => {
|
|||
// Mock environment details and context loading
|
||||
jest.spyOn(clineWithImages as any, "getEnvironmentDetails").mockResolvedValue("")
|
||||
jest.spyOn(clineWithoutImages as any, "getEnvironmentDetails").mockResolvedValue("")
|
||||
jest.spyOn(clineWithImages as any, "loadContext").mockImplementation(async (content) => [content, ""])
|
||||
jest.spyOn(clineWithoutImages as any, "loadContext").mockImplementation(async (content) => [
|
||||
content,
|
||||
"",
|
||||
])
|
||||
jest.spyOn(clineWithImages as any, "parseUserContent").mockImplementation(async (content) => content)
|
||||
jest.spyOn(clineWithoutImages as any, "parseUserContent").mockImplementation(async (content) => content)
|
||||
|
||||
// Set up mock streams
|
||||
const mockStreamWithImages = (async function* () {
|
||||
|
|
@ -885,7 +882,7 @@ describe("Cline", () => {
|
|||
await task.catch(() => {})
|
||||
})
|
||||
|
||||
describe("loadContext", () => {
|
||||
describe("parseUserContent", () => {
|
||||
it("should process mentions in task and feedback tags", async () => {
|
||||
const [cline, task] = Cline.create({
|
||||
provider: mockProvider,
|
||||
|
|
@ -929,7 +926,7 @@ describe("Cline", () => {
|
|||
]
|
||||
|
||||
// Process the content
|
||||
const [processedContent] = await cline["loadContext"](userContent)
|
||||
const processedContent = await cline.parseUserContent(userContent)
|
||||
|
||||
// Regular text should not be processed
|
||||
expect((processedContent[0] as Anthropic.TextBlockParam).text).toBe("Regular text with @/some/path")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue