unqommented
Version:
A Node.js utility that quickly identifies files with uncommented code in your codebase. Designed for developers who want to efficiently tell LLMs exactly which files need comments added.
28 lines (23 loc) • 871 B
JavaScript
require('qtests/setup');
const { test, expect, describe, beforeAll, afterAll } = require('@jest/globals');
const fs = require('fs');
const path = require('path');
const os = require('os');
const utils = require('../utils');
let tmpDir;
beforeAll(() => {
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'unq-backslash-'));
const nested = path.join(tmpDir, 'a', 'b');
fs.mkdirSync(nested, { recursive: true });
fs.writeFileSync(path.join(nested, 'uncommented.js'), 'const a = 1;');
});
afterAll(() => {
fs.rmSync(tmpDir, { recursive: true, force: true });
});
describe('findUncommentedFiles with backslash paths', () => {
test('handles directory path containing backslashes', async () => {
const arg = `${tmpDir}\\a\\b`;
const result = await utils.findUncommentedFiles(arg);
expect(result.uncommentedFiles).toEqual(['uncommented.js']);
});
});