mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-14 22:02:59 -07:00
feat(core): Download ripgrep at runtime, if enabled. (#7818)
This commit is contained in:
@@ -28,6 +28,7 @@ import {
|
||||
processSingleFileContent,
|
||||
detectBOM,
|
||||
readFileWithEncoding,
|
||||
fileExists,
|
||||
} from './fileUtils.js';
|
||||
import { StandardFileSystemService } from '../services/fileSystemService.js';
|
||||
|
||||
@@ -133,6 +134,25 @@ describe('fileUtils', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('fileExists', () => {
|
||||
it('should return true if the file exists', async () => {
|
||||
const testFile = path.join(tempRootDir, 'exists.txt');
|
||||
actualNodeFs.writeFileSync(testFile, 'content');
|
||||
await expect(fileExists(testFile)).resolves.toBe(true);
|
||||
});
|
||||
|
||||
it('should return false if the file does not exist', async () => {
|
||||
const testFile = path.join(tempRootDir, 'does-not-exist.txt');
|
||||
await expect(fileExists(testFile)).resolves.toBe(false);
|
||||
});
|
||||
|
||||
it('should return true for a directory that exists', async () => {
|
||||
const testDir = path.join(tempRootDir, 'exists-dir');
|
||||
actualNodeFs.mkdirSync(testDir);
|
||||
await expect(fileExists(testDir)).resolves.toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('isBinaryFile', () => {
|
||||
let filePathForBinaryTest: string;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user