Skip to content

Commit

Permalink
Merge pull request #37 from dichovsky/replaceSyncFsMethodsToAsync
Browse files Browse the repository at this point in the history
update pdfjs to 3.6.172, replace sync fs functions to async
  • Loading branch information
dichovsky committed Jul 2, 2023
2 parents 0751379 + a9d10f9 commit ae38a9e
Show file tree
Hide file tree
Showing 8 changed files with 597 additions and 410 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: macos-11
strategy:
matrix:
node: [ 18, 19 ]
node: [ 18, 20 ]
steps:
- uses: actions/checkout@v2
- name: Test on macos-11 Use Node.js ${{ matrix.node }}
Expand All @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ 18, 19 ]
node: [ 18, 20 ]
steps:
- uses: actions/checkout@v2
- name: Test on Ubuntu Use Node.js ${{ matrix.node }}
Expand All @@ -38,7 +38,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
node: [ 18, 19 ]
node: [ 18, 20 ]
steps:
- uses: actions/checkout@v2
- name: Test on Windows Use Node.js ${{ matrix.node }}
Expand Down
2 changes: 1 addition & 1 deletion __tests__/pdf.to.file.ts
@@ -1,6 +1,6 @@
import { readFileSync } from 'node:fs';
import { resolve } from 'node:path';
import { pdfToPng, PngPageOutput } from '../src';
import { PngPageOutput, pdfToPng } from '../src';
import { comparePNG } from '../src/compare.png';

test(`should convert PDF To PNG files`, async () => {
Expand Down
8 changes: 0 additions & 8 deletions __tests__/pdf.to.png.exceptions.ts
@@ -1,14 +1,6 @@
import { resolve } from 'node:path';
import { pdfToPng } from '../src';

test(`should throw "PDF file not found" exception`, async () => {
const pdfFilePath: string = resolve('non_existing_file.pdf');

await expect(async () => {
await pdfToPng(pdfFilePath);
}).rejects.toThrow(Error);
});

test(`should throw error when page index = 0 is requested`, async () => {
const pdfFilePath: string = resolve('test-data/large_pdf.pdf');

Expand Down
1 change: 1 addition & 0 deletions jest.config.ts
Expand Up @@ -2,6 +2,7 @@ import type { Config } from 'jest';

export default async (): Promise<Config> => {
return {
testTimeout: 30000,
collectCoverage: true,
coverageDirectory: './test-results/coverage',
preset: 'ts-jest',
Expand Down

0 comments on commit ae38a9e

Please sign in to comment.