diff --git a/packages/view/src/drivers/handlebars/handlebars-driver.ts b/packages/view/src/drivers/handlebars/handlebars-driver.ts index 60bddb6a..667d9142 100644 --- a/packages/view/src/drivers/handlebars/handlebars-driver.ts +++ b/packages/view/src/drivers/handlebars/handlebars-driver.ts @@ -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 { + async render (view: string, data: any, viewConfig: ViewResponseConfig = {}): Promise { return this.hasLayout(viewConfig) ? await this.renderWithLayout(view, data, viewConfig) : await this.renderView(view, data) diff --git a/packages/view/test/view-manager.js b/packages/view/test/view-manager.js index efb347dd..5e20b2df 100644 --- a/packages/view/test/view-manager.js +++ b/packages/view/test/view-manager.js @@ -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 () => { @@ -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 () => {