fix(core): update
This commit is contained in:
@ -1,11 +1,11 @@
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import * as smartpdf from '../ts/index';
|
||||
import * as smartpdf from '../ts/index.js';
|
||||
|
||||
let testSmartPdf: smartpdf.SmartPdf;
|
||||
|
||||
tap.test('should create a valid instance of smartpdf', async () => {
|
||||
testSmartPdf = new smartpdf.SmartPdf();
|
||||
expect(testSmartPdf).to.be.instanceof(smartpdf.SmartPdf);
|
||||
expect(testSmartPdf).toBeInstanceOf(smartpdf.SmartPdf);
|
||||
});
|
||||
|
||||
tap.test('should start the instance', async () => {
|
||||
@ -31,7 +31,7 @@ tap.test('should create a pdf from website as single page PDF', async () => {
|
||||
tap.test('should create a valid PDFResult', async () => {
|
||||
const writePDfToDisk = async (urlArg: string, fileName: string) => {
|
||||
const pdfResult = await testSmartPdf.getFullWebsiteAsSinglePdf(urlArg);
|
||||
expect(pdfResult.buffer).to.be.instanceOf(Buffer);
|
||||
expect(pdfResult.buffer).toBeInstanceOf(Buffer);
|
||||
const fs = await import('fs');
|
||||
|
||||
if (!fs.existsSync('.nogit/')) {
|
||||
@ -40,7 +40,7 @@ tap.test('should create a valid PDFResult', async () => {
|
||||
fs.writeFileSync(`.nogit/${fileName}`, pdfResult.buffer);
|
||||
};
|
||||
await writePDfToDisk('https://maintainedby.lossless.com/', '1.pdf')
|
||||
await writePDfToDisk('https://rendertron.lossless.one/render/https://lossless.com', '2.pdf')
|
||||
await writePDfToDisk('https://rendertron.lossless.one/render/https://fitnessloft.de/impressum/', '2.pdf')
|
||||
});
|
||||
|
||||
tap.test('should combine pdfs', async () => {
|
||||
|
Reference in New Issue
Block a user