fix(core): update

This commit is contained in:
2022-03-24 14:57:16 +01:00
parent 157bcff7c4
commit 9b698c6dea
5 changed files with 8708 additions and 17608 deletions

View File

@ -1,25 +1,25 @@
import { tap, expect } from '@pushrocks/tapbundle';
import { tap, expect, expectAsync } from '@pushrocks/tapbundle';
import * as smartbrowser from '../ts/index';
import * as smartbrowser from '../ts/index.js';
let testSmartBrowser: smartbrowser.SmartBrowser;
tap.test('should instanstiate a new browser ', async () => {
testSmartBrowser = new smartbrowser.SmartBrowser();
return expect(testSmartBrowser).to.be.instanceof(smartbrowser.SmartBrowser);
return expect(testSmartBrowser).toBeInstanceOf(smartbrowser.SmartBrowser);
});
tap.test('should start the browser ', async () => {
await expect(testSmartBrowser.start()).to.eventually.be.fulfilled;
await testSmartBrowser.start();
});
tap.test('should create a PDF from a page', async (tools) => {
const result = await testSmartBrowser.pdfFromPage('https://lossless.com');
expect(result.buffer).to.be.instanceOf(Buffer);
expect(result.buffer).toBeInstanceOf(Buffer);
});
tap.test('should produce a valid screenshot', async (tools) => {
const result = await testSmartBrowser.screenshotFromPage('https://lossless.com');
expect(result.buffer).to.be.instanceOf(Buffer);
expect(result.buffer).toBeInstanceOf(Buffer);
});
tap.test('should evalute something in the browser', async () => {
@ -30,7 +30,7 @@ tap.test('should evalute something in the browser', async () => {
});
tap.test('should stop the browser ', async () => {
await expect(testSmartBrowser.stop()).to.eventually.be.fulfilled;
await testSmartBrowser.stop();
});
tap.start();