-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(cdk/testing): require at least one argument locator functions #23384
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
Conversation
Currently the locator functions are written with a single rest parameter which means that no arguments can be passed as well, even though it'll result in an error at runtime. These changes rework the type so that at least one argument is required to be passed in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Oh, CI is red?
Yeah, looks like this doesn't handle mixed usages very well. I'll see if I can work around it. |
It looks like typing mixed arguments isn't possible :(. Closing the PR. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I believe you can accomplish this by having |
I just gave it a shot, but I'm not sure it's what we want either. We'd need to allow something like |
I think the same pattern still works? Just change |
Nice, that one works as expected! Here's a PR to implement it #23619. |
Currently the locator functions are written with a single rest parameter which means that no arguments can be passed as well, even though it'll result in an error at runtime.
These changes rework the type so that at least one argument is required to be passed in.