mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-23 03:24:42 -07:00
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
|
|
/**
|
||
|
|
* @license
|
||
|
|
* Copyright 2026 Google LLC
|
||
|
|
* SPDX-License-Identifier: Apache-2.0
|
||
|
|
*/
|
||
|
|
|
||
|
|
import { describe, expect } from 'vitest';
|
||
|
|
import { evalTest } from './test-helper.js';
|
||
|
|
|
||
|
|
describe('Output Verification', () => {
|
||
|
|
/**
|
||
|
|
* Verifies that the agent checks for "No tests found" in the output.
|
||
|
|
*/
|
||
|
|
evalTest('USUALLY_PASSES', {
|
||
|
|
name: 'should identify an empty test run as incomplete',
|
||
|
|
files: {
|
||
|
|
'src/app.ts': 'export const x = 1;',
|
||
|
|
'package.json': JSON.stringify({
|
||
|
|
name: 'test-project',
|
||
|
|
type: 'module',
|
||
|
|
scripts: {
|
||
|
|
test: 'echo "No tests found"', // Silently "passes" with code 0 but no work done
|
||
|
|
},
|
||
|
|
}),
|
||
|
|
},
|
||
|
|
prompt:
|
||
|
|
'Run the tests for this project and verify they passed. If no tests are found, you must report it.',
|
||
|
|
assert: async (rig, result) => {
|
||
|
|
// The agent should realize no tests were run despite the success exit code
|
||
|
|
expect(
|
||
|
|
result.toLowerCase(),
|
||
|
|
'Agent should have reported that no tests were found',
|
||
|
|
).toMatch(/no tests found|no tests executed|empty test suite/i);
|
||
|
|
},
|
||
|
|
});
|
||
|
|
});
|