UNPKG

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.

19 lines (14 loc) 569 B
require('qtests/setup'); const { test, expect, describe } = require('@jest/globals'); const fs = require('fs'); const utils = require('../utils'); // Test to ensure error events trigger rejection and cleanup describe('hasUncommentedCode stream read error handling', () => { test('rejects on read error', async () => { jest.spyOn(fs, 'createReadStream').mockImplementation(() => { throw new Error('read error'); }); await expect(utils.hasUncommentedCode('fake.js')).rejects.toThrow('read error'); fs.createReadStream.mockRestore(); }); });