Closed b-fa-ce closed 2 months ago
As far as I can see there is an issue when trying to run the package as part of a jest test which results in a segmentation fault error, SIGSEGV. A minimal example is
jest
SIGSEGV
import { pdfToPng } from 'pdf-to-png-converter'; export async function convertToPng() { const pdfPath = 'test.pdf'; const pngPath = './test-conversion'; const options = { outputFolder: pngPath, }; await pdfToPng(pdfPath, options); } convertToPng();
Running
import { convertToPng } from './testPdfToPng'; describe('example', () => { convertToPng(); });
via yarn jest testPdfToPng results in error Command failed with signal "SIGSEGV".
yarn jest testPdfToPng
error Command failed with signal "SIGSEGV".
While running it via ts-node path-to/testPdfToPng.ts works fine and converts the pdf.
ts-node path-to/testPdfToPng.ts
Environment
Jest doesn’t natively support ESM yet, so I use vitest instead
Current Behaviour
As far as I can see there is an issue when trying to run the package as part of a
jest
test which results in a segmentation fault error,SIGSEGV
. A minimal example isRunning
via
yarn jest testPdfToPng
results inerror Command failed with signal "SIGSEGV".
While running it via
ts-node path-to/testPdfToPng.ts
works fine and converts the pdf.Environment