feat: add md<->pdf document converters
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -100,4 +100,16 @@ describe('document converters', () => {
|
||||
expect(markdown).toContain('# Heading');
|
||||
expect(markdown).toContain('**bold**');
|
||||
});
|
||||
|
||||
it('converts MD to a valid PDF', async () => {
|
||||
const inputPath = path.join(tmpDir, 'fixture-for-pdf.md');
|
||||
await fs.writeFile(inputPath, '# Heading\n\nSome text.');
|
||||
const outputPath = path.join(tmpDir, 'from-md.pdf');
|
||||
const entry = resolve('md', 'pdf');
|
||||
|
||||
await entry.convert(inputPath, outputPath);
|
||||
|
||||
const detected = await detectInputMime(outputPath);
|
||||
expect(detected.mime).toBe('application/pdf');
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user