Skip to content

Commit 937c3b6

Browse files
committed
Remove test files list from index.ts
Update documentation Update modes.test.ts to use PR comment suggestion for pulling out reponse grade
1 parent 1e279b4 commit 937c3b6

File tree

3 files changed

+7
-19
lines changed

3 files changed

+7
-19
lines changed

src/test/VSCODE_INTEGRATION_TESTS.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ declare global {
7575
npm run test:integration
7676
```
7777

78+
3. If you want to run a specific test, you can use the `test.only` function in the test file. This will run only the test you specify and ignore the others.
79+
7880
The tests will:
7981

8082
- Download and launch a clean VSCode instance
@@ -88,13 +90,7 @@ When writing new integration tests:
8890

8991
1. Create a new test file in `src/test/suite/` with the `.test.ts` extension
9092

91-
2. Add the test file to the `files` array in `suite/index.ts` (you can temporarily comment out the other tests to run just the new test):
92-
93-
```typescript
94-
const files = ["suite/modes.test.js", "suite/tasks.test.js", "suite/extension.test.js", "suite/your-new-test.test.js"]
95-
```
96-
97-
3. Structure your tests using the TDD interface:
93+
2. Structure your tests using the TDD interface:
9894

9995
```typescript
10096
import * as assert from "assert"
@@ -107,7 +103,7 @@ suite("Your Test Suite Name", () => {
107103
})
108104
```
109105

110-
4. Use the global objects (`api`, `provider`, `extension`, `panel`) to interact with the extension
106+
3. Use the global objects (`api`, `provider`, `extension`, `panel`) to interact with the extension
111107

112108
### Best Practices
113109

src/test/suite/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ export async function run(): Promise<void> {
2525
// Find all test files
2626
const files = await glob("**/**.test.js", { cwd: testsRoot })
2727

28-
//If you want to run a specific test, comment out the above line and uncomment the following line and add the test file to the array
29-
//const files = ["suite/modes.test.js"]
30-
3128
// Add files to the test suite
3229
files.forEach((f: string) => mocha.addFile(path.resolve(testsRoot, f)))
3330

src/test/suite/modes.test.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,9 @@ suite("Roo Code Modes", () => {
9292
const gradeMessage = globalThis.provider.messages.find(
9393
({ type, text }) => type === "say" && !text?.includes("Grade: (1-10)") && text?.includes("Grade:"),
9494
)?.text
95-
const grade = gradeMessage?.match(/Grade: (10|[1-9])/)
96-
assert.ok(
97-
grade?.includes("Grade: 10") ||
98-
grade?.includes("Grade: 9") ||
99-
grade?.includes("Grade: 8") ||
100-
grade?.includes("Grade: 7"),
101-
"Did not receive expected response containing 'Grade: 10' or 'Grade: 9' or 'Grade: 8' or 'Grade: 7'",
102-
)
95+
const gradeMatch = gradeMessage?.match(/Grade: (\d+)/)
96+
const gradeNum = gradeMatch ? parseInt(gradeMatch[1]) : undefined
97+
assert.ok(gradeNum !== undefined && gradeNum >= 7 && gradeNum <= 10, "Grade must be between 7 and 10")
10398
} finally {
10499
}
105100
})

0 commit comments

Comments
 (0)