smartpdf/test/test.ts

24 lines
671 B
TypeScript
Raw Normal View History

2018-10-06 13:25:45 +00:00
import { expect, tap } from '@pushrocks/tapbundle';
2018-10-06 15:35:26 +00:00
import * as smartpdf from '../ts/index';
2018-10-06 13:25:45 +00:00
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);
2018-10-06 15:35:26 +00:00
});
2018-10-06 13:25:45 +00:00
tap.test('should create a pdf from html string', async () => {
await testSmartPdf.getPdfForHtmlString('hi');
});
tap.test('should create a pdf from website', async () => {
2019-04-10 13:12:54 +00:00
await testSmartPdf.getPdfForWebsite('https://maintainedby.lossless.com');
2018-10-06 13:25:45 +00:00
});
2018-10-06 15:35:26 +00:00
tap.test('should be able to close properly', async () => {
await testSmartPdf.close();
});
tap.start();