diff --git a/packages/history/__tests__/memory-test.js b/packages/history/__tests__/memory-test.js index 906c68a4..53a12350 100644 --- a/packages/history/__tests__/memory-test.js +++ b/packages/history/__tests__/memory-test.js @@ -27,6 +27,10 @@ describe("a memory history", () => { expect(typeof history.index).toBe("number"); }); + it('has an entries property', () => { + expect(Array.isArray(history.entries)).toBe(true); + }); + it("knows how to create hrefs", () => { const href = history.createHref({ pathname: "/the/path", diff --git a/packages/history/index.ts b/packages/history/index.ts index c8cdfc04..97536cdb 100644 --- a/packages/history/index.ts +++ b/packages/history/index.ts @@ -315,6 +315,7 @@ export interface HashHistory extends History {} */ export interface MemoryHistory extends History { readonly index: number; + readonly entries: Location[]; } const readOnly: (obj: T) => Readonly = __DEV__ @@ -973,6 +974,9 @@ export function createMemoryHistory( get index() { return index; }, + get entries() { + return entries; + }, get action() { return action; },