remix-run / history

Manage session history with JavaScript
MIT License
8.29k stars 960 forks source link

Test improvement: push and replace of Partial<Path> #920

Open thejohnhoffer opened 2 years ago

thejohnhoffer commented 2 years ago

Expected behavior

Tests should ensure history.push and history.replace work with to: Partial<Path>.

Actual behavior

All test sequences only test with to: string.

Details

This seems to be an oversight with the tests. Both history.push and history.replace have a first argument of type To. The type definition for To allows two options: Partial<Path> and string.

However, it seems that all test sequences call push and replace with strings, never with objects that contain keys of Path. I've created a PR that solves this issue.