Skip to content

Commit 1275fe9

Browse files
committed
Add pdf output test
1 parent 439cea8 commit 1275fe9

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

.github/workflows/node.js.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ jobs:
2828
cache: 'yarn'
2929
- run: yarn
3030
- uses: nikeee/setup-pandoc@v1
31+
- run: sudo apt-get install texlive-latex-extra texlive-luatex
3132
- run: npm test

src/index.spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,17 @@ describe('Output formats', () => {
7676
const expected = fs.readFileSync('test/diff.docx.md', 'utf8');
7777
expectWithFallback(text, expected, 'test/diff.docx.md');
7878
});
79+
it('PDF', async function () {
80+
this.timeout(10000); // Increase timeout for PDF generation
81+
process.chdir('test');
82+
await pandiff('old.md', 'new.md', {
83+
files: true,
84+
output: 'diff.pdf',
85+
'pdf-engine': 'lualatex',
86+
});
87+
expect(fs.existsSync('diff.pdf')).to.be.true;
88+
process.chdir('..');
89+
});
7990
});
8091

8192
describe('Track Changes', () => {

test/diff.pdf

-71.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)