Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marcuspoehls committed Dec 11, 2023
1 parent 0c383a9 commit 945ff91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/view/src/drivers/handlebars/handlebars-driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ export class HandlebarsDriver extends ViewBaseDriver implements ViewEngine {
/**
* Returns the rendered HTML view.
*/
async render (view: string, data: any, viewConfig: ViewResponseConfig): Promise<string> {
async render (view: string, data: any, viewConfig: ViewResponseConfig = {}): Promise<string> {
return this.hasLayout(viewConfig)
? await this.renderWithLayout(view, data, viewConfig)
: await this.renderView(view, data)
Expand Down
4 changes: 2 additions & 2 deletions packages/view/test/view-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ test('throws for invalid views path', async () => {

await expect(async () => {
return view.render('test-view')
}).rejects.toThrow(`Path to view files not existing. Received ${viewsPath}`)
}).rejects.toThrow(`Path to view files not existing. Received "${viewsPath}"`)
})

test('throws when rendering a view with not-existing layout', async () => {
Expand All @@ -77,7 +77,7 @@ test('throws for misconfigured layouts path', async () => {

await expect(async () => {
await view.render('test-view', { name: 'Supercharge ' }, { layout: 'test' })
}).rejects.toThrow(`Path to view layouts not existing. Received ${layoutsPath}`)
}).rejects.toThrow(`Path to view layouts not existing. Received "${layoutsPath}"`)
})

test('throws when rendering a view with not-existing layout', async () => {
Expand Down

0 comments on commit 945ff91

Please sign in to comment.