Closed renet closed 11 months ago
@renet Thanks, I'll see what I can do, would definitely be a nice quality of life improvement. I think it should be doable.
@renet sorry I've let this slip, I'll see if I can put something together in the next couple days
Implemented in v1.11.1
Let me know if it works for you @renet !
Thank you very much! 💛 Works like a charm with regular selectors, but sub-selectors of within(...)
are still not typable.
Doh! Thanks! I'll take a look!
@renet Totally annoyed with how RTL doesn't preserve query function signatures, but I managed to get it working with a fantastically ugly hack.
https://github.com/KonnorRogers/shadow-dom-testing-library/pull/54
Released in v1.11.2
The
@testing-library/dom
uses generics for typing the return value of their query functions like so:The
shadow-dom-testing-library
however only returns an element of typeHTMLElement
without the possibility to set a different type. It would be great, if one had the possibility to set a custom type when using a shadow query function like so: