feat(core): Download ripgrep at runtime, if enabled. (#7818)

This commit is contained in:
joshualitt
2025-09-08 14:44:56 -07:00
committed by GitHub
parent 097b5c734f
commit f0bbfe5f0a
17 changed files with 408 additions and 123 deletions
+20
View File
@@ -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;