MCPcopy
hub / github.com/google-gemini/gemini-cli / runTestCase

Function runTestCase

integration-tests/policy-headless.test.ts:116–140  ·  view source on GitHub ↗
(tc: TestCase)

Source from the content-addressed store, hash-verified

114 });
115
116 const runTestCase = async (tc: TestCase) => {
117 const fakeResponsesPath = join(import.meta.dirname, tc.responsesFile);
118 rig.setup(tc.name, { fakeResponsesPath });
119
120 testFile = rig.createFile('test.txt', 'Lorem\nIpsum\nDolor\n');
121 const args = ['-p', tc.promptCommand.prompt(testFile)];
122
123 if (tc.policyContent) {
124 const policyPath = rig.createFile('test-policy.toml', tc.policyContent);
125 args.push('--policy', policyPath);
126 }
127
128 const result = await rig.run({
129 args,
130 approvalMode: 'default',
131 });
132
133 await verifyToolExecution(
134 rig,
135 tc.promptCommand,
136 result,
137 tc.expectAllowed,
138 tc.expectedDenialString,
139 );
140 };
141
142 const testCases = [
143 {

Callers 1

Calls 6

verifyToolExecutionFunction · 0.85
createFileMethod · 0.80
pushMethod · 0.80
setupMethod · 0.45
promptMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected