[next/head] Add helmet-like .peek() support #23935
ljosberinn
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Feature request
Is your feature request related to a problem? Please describe.
I'm trying to test a component that does nothing but syncing some state into through next/head. However, next/head is actually a null component that just emits changes internally.
Sadly I haven't found any, not even a hacky, solution to spying on the element creation...
Describe the solution you'd like
A static method like react-helmets
.peek()
that can be used in tests. which returns the currently existing HTMLCollection just like adocument.querySelector('head').children
would.Describe alternatives you've considered
What I've tried:
Additional context
This was with jest@latest + @testing-library/react@latest.
Beta Was this translation helpful? Give feedback.
All reactions