Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/history/__tests__/memory-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions packages/history/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ export interface HashHistory extends History {}
*/
export interface MemoryHistory extends History {
readonly index: number;
readonly entries: Location[];
}

const readOnly: <T>(obj: T) => Readonly<T> = __DEV__
Expand Down Expand Up @@ -973,6 +974,9 @@ export function createMemoryHistory(
get index() {
return index;
},
get entries() {
return entries;
},
get action() {
return action;
},
Expand Down