modesty / pdf2json

converts binary PDF to JSON and text, for server-side PDF processing and command-line use.
https://github.com/modesty/pdf2json
Other
2.01k stars 377 forks source link

Problem with jest #120

Closed spekulatif1 closed 6 months ago

spekulatif1 commented 7 years ago

I've a test case, which downloads a pdf file from a url then parses and validates result. Sample code is below, but it doesn't work or crashes either.

const request = require('request');
const PDFParser = require("pdf2json");
const pdfParser = new PDFParser();

it('should validate pdf', (done) => {
  request
   .get(url)
   .pipe(pdfParser)

  pdfParser.on("pdfParser_dataError", errData => done(errData));
  pdfParser.on("pdfParser_dataReady", pdfData => {
   expect(pdfData).toMatchSnapshot();
    done()
  });
});
ghost commented 4 years ago

the same problem, could you solve it

modesty commented 6 months ago

jest replaced vows in 3.1.2, please ref ./test/test.cjs