Skip to content

Commit

Permalink
☔ test(pdf): Prevent regression when upgrading pdfjs-dist.
Browse files Browse the repository at this point in the history
  • Loading branch information
make-github-pseudonymous-again committed May 11, 2024
1 parent 377dde0 commit 5ae578d
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions imports/lib/pdf/pdf.tests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// eslint-disable-next-line import/no-unassigned-import
import 'regenerator-runtime/runtime.js';

import {client, server} from '../../_test/fixtures';

import {fetchPDF} from './pdf';

const document = `%PDF-1.
1 0 obj<</Pages 2 0 R>>endobj
2 0 obj<</Kids[3 0 R]/Count 1>>endobj
3 0 obj<</Parent 2 0 R>>endobj
trailer <</Root 1 0 R>>
`;

client(__filename, () => {
it('should work on the client', async () => {
const data = new TextEncoder().encode(document);
await fetchPDF({data});
});
});

server(__filename, () => {
it('should work on the server', async () => {
const data = new TextEncoder().encode(document);
await fetchPDF({data});
});
});

0 comments on commit 5ae578d

Please sign in to comment.