Fix Run All Tests to properly test both memory and no-memory scenarios
This commit is contained in:
+28
-9
@@ -390,26 +390,45 @@ async function runAllTests() {
|
||||
});
|
||||
}
|
||||
|
||||
// Test 2: Hardcoded Image
|
||||
// Test 2: Image with Memory Modules
|
||||
try {
|
||||
const response = await fetch(`${API_BASE_URL}/detect/hardcoded`);
|
||||
const result = await response.json();
|
||||
testResults.push({
|
||||
name: 'Hardcoded Image Detection',
|
||||
success: result.success,
|
||||
message: result.success ?
|
||||
`Found ${result.num_detections} memory modules` :
|
||||
`Error: ${result.error}`
|
||||
name: 'Image with Memory Modules',
|
||||
success: result.success && result.num_detections > 0,
|
||||
message: result.success ?
|
||||
`✅ Found ${result.num_detections} memory modules` :
|
||||
`❌ Error: ${result.error}`
|
||||
});
|
||||
} catch (error) {
|
||||
testResults.push({
|
||||
name: 'Hardcoded Image Detection',
|
||||
name: 'Image with Memory Modules',
|
||||
success: false,
|
||||
message: `Error: ${error.message}`
|
||||
message: `❌ Error: ${error.message}`
|
||||
});
|
||||
}
|
||||
|
||||
// Test 3: Image without Memory Modules
|
||||
try {
|
||||
const response = await fetch(`${API_BASE_URL}/detect/no-memory`);
|
||||
const result = await response.json();
|
||||
testResults.push({
|
||||
name: 'Image without Memory Modules',
|
||||
success: result.success && result.num_detections === 0,
|
||||
message: result.success ?
|
||||
`✅ Correctly detected ${result.num_detections} memory modules` :
|
||||
`❌ Error: ${result.error}`
|
||||
});
|
||||
} catch (error) {
|
||||
testResults.push({
|
||||
name: 'Image without Memory Modules',
|
||||
success: false,
|
||||
message: `❌ Error: ${error.message}`
|
||||
});
|
||||
}
|
||||
|
||||
// Test 3: API Information
|
||||
// Test 4: API Information
|
||||
try {
|
||||
const response = await fetch(`${API_BASE_URL}/api`);
|
||||
const result = await response.json();
|
||||
|
||||
Reference in New Issue
Block a user