refactor(test utils): Add options object to test utility functions (getRouteDataTestContext, getTestHead)#3544
Conversation
|
delucis
left a comment
There was a problem hiding this comment.
Lovely work @erbierc 👏 Appreciate how you laid out the idea and the work in the description — really helpful.
Btw, re: the second false-start PR — you can actually switch the target after opening a PR using the Edit button in the top right. Clicking that will make the PR title editable, but also makes it possible to switch the branch target just below there.
Anyway, I think this means we can merge this and then get that fix merged too 🎉
|
@delucis Good to know, thanks so much! |
Created a new PR, as the previous one (#3542) was synced with main, thus making reviewing it a pain. And the one after that, #3543 was set to main, not stack/invalid-canonical 🤡
Description
<head>#3496In a previous PR, I have added tests to the invalid canonical changes. This required me to include additional arguments to getRouteDataTestContext and getTestHead functions. This refactor is meant to make these changes more readable and developer friendly by adding an options object to both of them. This PR also makes sure all usage of these functions are updated as well. As of now, all tests pass.
Here, route has an additonal
| undefinedbecause of the 'includes description based on page description frontmatter field if provided' test in the same file (TypeScript doesn't like it without that).Other options object type added:
Note: I have placed the new types above these functions. If I need to move them, or if you would prefer interfaces instead, I'd really like to know!