Skip to content

Commit 6016d60

Browse files
committed
fix(runner): base options
1 parent dd706aa commit 6016d60

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

packages/pdfeasy/src/resolvers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const resolveRunnerOptions = (
1919
): RunOptions => {
2020
return {
2121
type: options.type || isBrowser ? 'client' : 'server',
22-
clientEmit: options.clientEmit || isBrowser ? 'blob' : 'none',
22+
clientEmit: options.clientEmit || 'blob',
2323
serverPath: options.serverPath || '/',
2424
colorSchema: options.colorSchema || 'RGB',
2525
cwd: options?.cwd || !isBrowser ? process.cwd() : '/',

packages/pdfeasy/src/runner.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,8 @@ export class PDFEasy {
321321
if (this.runOptions?.type === 'server') {
322322
this.pdfkit?.pipe(
323323
createWriteStream(
324-
path.resolve(
325-
(options?.cwd || process.cwd()) + this.runOptions.serverPath
326-
) + `/${this.options?.exports?.name || 'New PDF'}.pdf`
324+
path.resolve(this.runOptions.cwd + this.runOptions.serverPath) +
325+
`/${this.options?.exports?.name || 'New PDF'}.pdf`
327326
)
328327
)
329328

@@ -366,7 +365,7 @@ export class PDFEasy {
366365
})
367366

368367
stream.on('finish', (): void => {
369-
switch (options?.clientEmit || 'blob') {
368+
switch (this.runOptions?.clientEmit) {
370369
case 'blob':
371370
res(stream.toBlobURL('application/pdf') as string)
372371
break

packages/pdfeasy/vitest.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { defineConfig } from 'vite'
33

44
export default defineConfig({
55
test: {
6+
testTimeout: 10000,
67
environment: 'happy-dom',
78
coverage: {
89
include: ['src'],

0 commit comments

Comments
 (0)