fix(core): update

This commit is contained in:
Philipp Kunz 2019-06-04 11:29:30 +02:00
parent b4a3a36b07
commit 37e47fc33f
7 changed files with 13 additions and 21 deletions

3
.gitignore vendored
View File

@ -19,5 +19,4 @@ dist_web/
dist_serve/ dist_serve/
dist_ts_web/ dist_ts_web/
# custom # custom
assets/pdfdir

View File

@ -1,4 +1,4 @@
# gitzone standard # gitzone ci_default
image: hosttoday/ht-docker-node:npmci image: hosttoday/ht-docker-node:npmci
cache: cache:
@ -78,19 +78,10 @@ release:
# ==================== # ====================
codequality: codequality:
stage: metadata stage: metadata
image: docker:stable
allow_failure: true allow_failure: true
services:
- docker:stable-dind
script: script:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/') - npm install -g tslint typescript
- docker run - tslint -c tslint.json ./ts/**/*.ts
--env SOURCE_CODE="$PWD"
--volume "$PWD":/code
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
artifacts:
paths: [codeclimate.json]
tags: tags:
- docker - docker
- priv - priv

View File

@ -38,4 +38,4 @@
"npmextra.json", "npmextra.json",
"readme.md" "readme.md"
] ]
} }

View File

@ -25,7 +25,9 @@ tap.test('should create a pdf from website as single page PDF', async () => {
}); });
tap.test('should create a valid PDFResult', async () => { tap.test('should create a valid PDFResult', async () => {
const pdfResult = await testSmartPdf.getFullWebsiteAsSinglePdf('https://maintainedby.lossless.com'); const pdfResult = await testSmartPdf.getFullWebsiteAsSinglePdf(
'https://maintainedby.lossless.com'
);
expect(pdfResult.buffer).to.be.instanceOf(Buffer); expect(pdfResult.buffer).to.be.instanceOf(Buffer);
}); });

View File

@ -1 +1 @@
export * from './interface.pdfresult'; export * from './interface.pdfresult';

View File

@ -1,5 +1,5 @@
export interface IPdfResult { export interface IPdfResult {
name: string, name: string;
id: string, id: string;
buffer: Buffer; buffer: Buffer;
} }

View File

@ -21,7 +21,7 @@ export class SmartPdf {
async start(headlessBrowserArg?) { async start(headlessBrowserArg?) {
// lets set the external browser in case one is provided // lets set the external browser in case one is provided
this.headlessBrowser = headlessBrowserArg this.headlessBrowser = headlessBrowserArg;
// setup puppeteer // setup puppeteer
if (this.headlessBrowser) { if (this.headlessBrowser) {
this.externalBrowserBool = true; this.externalBrowserBool = true;
@ -50,7 +50,7 @@ export class SmartPdf {
this.htmlServerInstance.close(() => { this.htmlServerInstance.close(() => {
done.resolve(); done.resolve();
}); });
if (!this.externalBrowserBool) { if (!this.externalBrowserBool) {
await this.headlessBrowser.close(); await this.headlessBrowser.close();
} }