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.
26 lines (21 loc) • 809 B
JavaScript
require('qtests/setup');
const { test, expect, describe, beforeAll, afterAll } = require('@jest/globals');
const fs = require('fs');
const os = require('os');
const path = require('path');
const utils = require('../utils');
const localVars = require('../../config/localVars');
let tmpDir;
beforeAll(() => {
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'unq-invalid-stream-'));
fs.writeFileSync(path.join(tmpDir, 'uncommented.js'), 'const a = 1;');
});
afterAll(() => {
fs.rmSync(tmpDir, { recursive: true, force: true });
});
describe('findUncommentedFiles invalid output stream', () => {
test('rejects when outputStream lacks write method', async () => {
await expect(utils.findUncommentedFiles(tmpDir, {}))
.rejects.toThrow(localVars.ERROR_MESSAGES.OUTPUT_STREAM_INVALID);
});
});