Skip to content

Commit

Permalink
Add test for 'new' as buffer content
Browse files Browse the repository at this point in the history
  • Loading branch information
julianhille committed Oct 20, 2024
1 parent 0c94191 commit 3b08e53
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/recipe/createWithBuffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,25 @@ describe("Modify", () => {
done();
});
});

it("Create new Writer With new buffer and file output", (done) => {

const pdfDoc = new HummusRecipe(Buffer.from("new"), null, {
version: 1.6,
author: "John Doe",
title: "Hummus Recipe",
subject: "A brand new PDF",
});
const pdfBuffer = pdfDoc
.createPage("letter-size")
.endPage()
.endPDF((outBuffer) => {
assert(outBuffer instanceof Buffer);
fs.writeFileSync(
path.join(__dirname, "../output/createWithNewBuffer.pdf"),
outBuffer,
);
done();
});
});
});

0 comments on commit 3b08e53

Please sign in to comment.