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

Test IDs #77

Open
dgp1130 opened this issue Nov 6, 2023 · 0 comments
Open

Test IDs #77

dgp1130 opened this issue Nov 6, 2023 · 0 comments

Comments

@dgp1130
Copy link
Owner

dgp1130 commented Nov 6, 2023

While working on the docs site, I found it useful to have test IDs so certain elements could be identified at test time. While I think this is generally an anti-pattern to be avoided, sometimes it is useful. @rules_prerender in particular happens to be pretty good at this since the test IDs can be relatively trivially removed from the production build, as if they were never there. Should experiment to see if it's worth making this a real public API of @rules_prerender.

One other question: Is test ID the right primitive, or do we want more comprehensive "testonly logic" support built into the rendering process? Similar to how test IDs are kind of an anti-pattern, I would also argue that testonly logic in production code is an anti-pattern. Need to investigate more to see.

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

No branches or pull requests

1 participant