From 353277d5e831a19a83e8cfcddcf82605f7cb48d9 Mon Sep 17 00:00:00 2001 From: pgayvallet Date: Fri, 10 Apr 2020 10:29:09 +0200 Subject: [PATCH] use object options for createHref --- src/core/public/application/scoped_history.test.ts | 8 ++++---- src/core/public/application/scoped_history.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/public/application/scoped_history.test.ts b/src/core/public/application/scoped_history.test.ts index d734a667844b86..a56cffef1e2f27 100644 --- a/src/core/public/application/scoped_history.test.ts +++ b/src/core/public/application/scoped_history.test.ts @@ -289,10 +289,10 @@ describe('ScopedHistory', () => { const gh = createMemoryHistory(); gh.push('/app/wow'); const h = new ScopedHistory(gh, '/app/wow'); - expect(h.createHref({ pathname: '' }, false)).toEqual(`/`); - expect(h.createHref({ pathname: '/new-page', search: '?alpha=true' }, false)).toEqual( - `/new-page?alpha=true` - ); + expect(h.createHref({ pathname: '' }, { prependBasePath: false })).toEqual(`/`); + expect( + h.createHref({ pathname: '/new-page', search: '?alpha=true' }, { prependBasePath: false }) + ).toEqual(`/new-page?alpha=true`); }); }); diff --git a/src/core/public/application/scoped_history.ts b/src/core/public/application/scoped_history.ts index 6c145dfff842de..9fa8f0b7f81481 100644 --- a/src/core/public/application/scoped_history.ts +++ b/src/core/public/application/scoped_history.ts @@ -226,7 +226,7 @@ export class ScopedHistory */ public createHref = ( location: LocationDescriptorObject, - prependBasePath: boolean = true + { prependBasePath = true }: { prependBasePath?: boolean } = {} ): Href => { this.verifyActive(); if (prependBasePath) {