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

Compare imports as sorted array #862

Merged
merged 2 commits into from
Oct 8, 2024
Merged

Conversation

tinder-garricnahapetian
Copy link
Contributor

@tinder-garricnahapetian tinder-garricnahapetian commented Oct 7, 2024

Since imports(with:including:) returns a Set, the expected value created using array literal syntax in the expectation against imports is also a Set. Sets automatically de-dupe the contents of the array literal. That is why this test did not fail. By converting the actual value to an Array, the expected value also becomes an Array and any duplicate values will not be removed.

Arrays are ordered, therefore, we need to sort the imports to make the test predictable as Set is unordered.

The uiFrameworkImport is dynamic so we need to add an additional handling for that case.

@tinder-garricnahapetian tinder-garricnahapetian merged commit 0408446 into main Oct 8, 2024
5 checks passed
@tinder-garricnahapetian tinder-garricnahapetian deleted the fix-imports branch October 8, 2024 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants