Browse Source

Change index.ts to always run all tests
Add regex look for grade in in modes.test.ts

ColemanRoo 11 months ago
parent
commit
eb826b1c90
2 changed files with 6 additions and 3 deletions
  1. 4 2
      src/test/suite/index.ts
  2. 2 1
      src/test/suite/modes.test.ts

+ 4 - 2
src/test/suite/index.ts

@@ -23,8 +23,10 @@ export async function run(): Promise<void> {
 
 	try {
 		// Find all test files
-		//const files = await glob("**/**.test.js", { cwd: testsRoot } leaving this commented out for now since we only have three tests
-		const files = ["suite/modes.test.js", "suite/task.test.js", "suite/extension.test.js"]
+		const files = await glob("**/**.test.js", { cwd: testsRoot })
+
+		//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
+		//const files = ["suite/modes.test.js"]
 
 		// Add files to the test suite
 		files.forEach((f: string) => mocha.addFile(path.resolve(testsRoot, f)))

+ 2 - 1
src/test/suite/modes.test.ts

@@ -89,9 +89,10 @@ suite("Roo Code Modes", () => {
 					console.log(text)
 				}
 			})
-			const grade = globalThis.provider.messages.find(
+			const gradeMessage = globalThis.provider.messages.find(
 				({ type, text }) => type === "say" && !text?.includes("Grade: (1-10)") && text?.includes("Grade:"),
 			)?.text
+			const grade = gradeMessage?.match(`Grade: (10|[1-9])`)
 			assert.ok(
 				grade?.includes("Grade: 10") ||
 					grade?.includes("Grade: 9") ||