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

testing: allow invalidateTestResults to take an array #183569

Merged
merged 1 commit into from
May 26, 2023

Conversation

connor4312
Copy link
Member

For #134970

@connor4312 connor4312 self-assigned this May 26, 2023
@connor4312 connor4312 enabled auto-merge (squash) May 26, 2023 17:50
@vscodenpa vscodenpa added this to the May 2023 milestone May 26, 2023
checkProposedApiEnabled(extension, 'testInvalidateResults');
const id = item ? TestId.fromExtHostTestItem(item, controllerId).toString() : controllerId;
return this.proxy.$markTestRetired(id);
for (const item of items instanceof Array ? items : [items]) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have been doing Array.isArray(arr) for ages. Is items instanceof Array better?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Iirc Array.isArray(arr) works if the array is coming from a different origin. I generally like instanceof Array since it's simpler and more consistent 🤷

Probably the nice way to do this now would be checking if the object has [Symbol.iterator], but we don't yet take Iterables into any methods in extension host APIs.

@connor4312 connor4312 merged commit d15a0aa into main May 26, 2023
@connor4312 connor4312 deleted the connor4312/retired-test-api-tweak branch May 26, 2023 18:07
@github-actions github-actions bot locked and limited conversation to collaborators Jul 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants