Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iterate over upstream queries to define delegates #6

Closed

Conversation

alexkrolick
Copy link

@alexkrolick alexkrolick commented Sep 27, 2018

This doesn't build (don't know Typescript), but this is a suggestion for how to define queries by iterating over the exports from dom-testing-library instead of hard-coding the names, so that the query list doesn't get out of date (the wrapper is already is missing some of the newer queries).

@patrickhulce
Copy link
Collaborator

Thanks very much for the contribution!! I sorted out the TS issues, but it's failing a few of the tests.

I don't mind the explicitness of the old approach though, especially since it ensures I'm following through on my promised types whereas here I've gotta sprinkle ts-ignore to get things moving. Any particular version you want me caught up to?

@alexkrolick
Copy link
Author

Not really, I just want to keep the ecosystem up to date so the wrappers don't diverge too much from what's available in dom-testing-library. It makes it much easier to switch between Jest and Puppeteer if the queries are the same.

Related:

@patrickhulce
Copy link
Collaborator

Ah thanks for the context! If Kent seems to think the API is mostly finalized, I'll stick with my type-check'd approach and do a manual update soon :)

Thanks very much for raising this!

@alexkrolick
Copy link
Author

There have been several new queries added lately, can you either add them to the hardcoded list or revisit this approach, please?

@patrickhulce
Copy link
Collaborator

your wish is my command @alexkrolick, v0.3.0 is out with dom-testing-library v3.11 💎 💨

@alexkrolick
Copy link
Author

Thanks. FYI I found an issue with error handling: testing-library/dom-testing-library#129 (comment)

You'll probably want to track this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants