Closed laiso closed 4 months ago
browser
concurrentLimit
generatePDF
p-limit
https://github.com/laiso/site2pdf/blob/a48ceacb2ec43f516506c7a12173c32cd1bf40a1/index.ts#L10-L16
puppeteer
fixture.pdf
console.log
https://github.com/laiso/site2pdf/blob/a48ceacb2ec43f516506c7a12173c32cd1bf40a1/index.test.ts#L17-L26
This enhances the PDF generation logic, improves testability, and adds concurrency control.
Concurrency Control:
browser
andconcurrentLimit
parameters to thegeneratePDF
function.p-limit
.https://github.com/laiso/site2pdf/blob/a48ceacb2ec43f516506c7a12173c32cd1bf40a1/index.ts#L10-L16
Test Improvements:
generatePDF
function using a mock browser.puppeteer
dependency.fixture.pdf
as a new fixture file.console.log
mocks before and after tests.https://github.com/laiso/site2pdf/blob/a48ceacb2ec43f516506c7a12173c32cd1bf40a1/index.test.ts#L17-L26
This enhances the PDF generation logic, improves testability, and adds concurrency control.