Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add test for issue #120 #124

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions test/browser-fixtures.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,16 @@ describe('PDFMerger', () => {
})
})

describe('test for specific issues', () => {
test('issue #120', async () => {
const merger = new PDFMerger()
const fileIssue120 = await readFixtureAsUint8Array('issue-120.pdf')
await merger.add(fileIssue120)
const buffer = await merger.saveAsBuffer()
expect(buffer).toBeInstanceOf(Uint8Array)
})
})

afterAll(async () => {
await fs.remove(TMP_DIR)
// await new Promise(resolve => setTimeout(resolve, 10000))
Expand Down
Binary file added test/fixtures/issue-120.pdf
Binary file not shown.
6 changes: 6 additions & 0 deletions test/issues.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ describe('issues', () => {
await merger.save(path.join(TMP_DIR, 'issue-88_merged.pdf'))
})

test('merge a encrypted pdf (#120)', async () => {
const merger = new PDFMerger()
await merger.add(path.join(FIXTURES_DIR, 'issue-120.pdf'))
await merger.save(path.join(TMP_DIR, 'issue-120_merged.pdf'))
})

test('merge the last pages of a pdf (#101)', async () => {
const merger = new PDFMerger()
await merger.add(path.join(FIXTURES_DIR, 'UDHR.pdf'), '7 to 8')
Expand Down
Loading