mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
Rename Page.printToPDF into page.pdf
This patch: - renames Page.printToPDF into page.pdf - adds a 'path' option to the page.pdf options instead of a separate `filePath` parameter - improves on the documentation for the `page.pdf` References #39.
This commit is contained in:
@@ -829,7 +829,7 @@ describe('Puppeteer', function() {
|
||||
}));
|
||||
});
|
||||
|
||||
describe('Page.printToPDF', function() {
|
||||
describe('Page.pdf', function() {
|
||||
let outputFile = __dirname + '/assets/output.pdf';
|
||||
afterEach(function() {
|
||||
fs.unlinkSync(outputFile);
|
||||
@@ -837,7 +837,7 @@ describe('Puppeteer', function() {
|
||||
|
||||
it('should print to pdf', SX(async function() {
|
||||
await page.navigate(PREFIX + '/grid.html');
|
||||
await page.printToPDF(outputFile);
|
||||
await page.pdf({path: outputFile});
|
||||
expect(fs.readFileSync(outputFile).byteLength).toBeGreaterThan(0);
|
||||
}));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user