Skip to content

Commit bada1ba

Browse files
committed
Fix e2e tests
1 parent 1525c39 commit bada1ba

File tree

6 files changed

+16
-21
lines changed

6 files changed

+16
-21
lines changed

apps/vscode-e2e/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"lint": "eslint src --ext=ts --max-warnings=0",
66
"check-types": "tsc -p tsconfig.esm.json --noEmit",
77
"format": "prettier --write src",
8-
"test:ci": "pnpm -w bundle && pnpm test:run",
8+
"test:ci": "pnpm -w bundle && pnpm --filter @roo-code/vscode-webview build && pnpm test:run",
99
"test:run": "rimraf out && tsc -p tsconfig.json && npx dotenvx run -f .env.local -- node ./out/runTest.js",
1010
"clean": "rimraf out .turbo"
1111
},

apps/vscode-e2e/src/suite/index.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ import type { RooCodeAPI } from "@roo-code/types"
77

88
import { waitFor } from "./utils"
99

10-
declare global {
11-
let api: RooCodeAPI
12-
}
13-
1410
export async function run() {
1511
const extension = vscode.extensions.getExtension<RooCodeAPI>("RooVeterinaryInc.roo-cline")
1612

@@ -23,13 +19,12 @@ export async function run() {
2319
await api.setConfiguration({
2420
apiProvider: "openrouter" as const,
2521
openRouterApiKey: process.env.OPENROUTER_API_KEY!,
26-
openRouterModelId: "google/gemini-2.0-flash-001",
22+
openRouterModelId: "openai/gpt-4.1",
2723
})
2824

2925
await vscode.commands.executeCommand("roo-cline.SidebarProvider.focus")
3026
await waitFor(() => api.isReady())
3127

32-
// @ts-expect-error - Expose the API to the tests.
3328
globalThis.api = api
3429

3530
// Add all the tests to the runner.

apps/vscode-e2e/src/suite/modes.test.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
11
import * as assert from "assert"
22

3-
import type { RooCodeAPI, ClineMessage } from "@roo-code/types"
3+
import type { ClineMessage } from "@roo-code/types"
44

55
import { waitUntilCompleted } from "./utils"
66

77
suite("Roo Code Modes", () => {
88
test("Should handle switching modes correctly", async () => {
9-
// @ts-expect-error - Expose the API to the tests.
10-
const api = globalThis.api as RooCodeAPI
11-
12-
/**
13-
* Switch modes.
14-
*/
9+
const api = globalThis.api
1510

1611
const switchModesPrompt =
1712
"For each mode (Architect, Ask, Debug) respond with the mode name and what it specializes in after switching to that mode."
1813

1914
const messages: ClineMessage[] = []
20-
2115
const modeSwitches: string[] = []
2216

2317
api.on("taskModeSwitched", (_taskId, mode) => {

apps/vscode-e2e/src/suite/subtasks.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import * as assert from "assert"
22

3-
import type { RooCodeAPI, ClineMessage } from "@roo-code/types"
3+
import type { ClineMessage } from "@roo-code/types"
44

55
import { sleep, waitFor, waitUntilCompleted } from "./utils"
66

77
suite.skip("Roo Code Subtasks", () => {
88
test("Should handle subtask cancellation and resumption correctly", async () => {
9-
// @ts-expect-error - Expose the API to the tests.
10-
const api = globalThis.api as RooCodeAPI
9+
const api = globalThis.api
1110

1211
const messages: Record<string, ClineMessage[]> = {}
1312

apps/vscode-e2e/src/suite/task.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import * as assert from "assert"
22

3-
import type { RooCodeAPI, ClineMessage } from "@roo-code/types"
3+
import type { ClineMessage } from "@roo-code/types"
44

55
import { waitUntilCompleted } from "./utils"
66

77
suite("Roo Code Task", () => {
88
test("Should handle prompt and response correctly", async () => {
9-
// @ts-expect-error - Expose the API to the tests.
10-
const api = globalThis.api as RooCodeAPI
9+
const api = globalThis.api
1110

1211
const messages: ClineMessage[] = []
1312

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import type { RooCodeAPI } from "@roo-code/types"
2+
3+
declare global {
4+
// eslint-disable-next-line no-var
5+
var api: RooCodeAPI
6+
}
7+
8+
export {}

0 commit comments

Comments
 (0)