Leave unknown names out of fetch_icons instead of raising - #1
Merged
Merged
Conversation
fetch_icons/2 called Set.get! for every requested name, so fetch_icon/2
raised for an unknown icon instead of returning {:error, :not_found}.
Also depend on the published json_codec 0.3 instead of a local path and
drop its deprecated fast_path option. E2E tests against the Iconify API
run with mix test.e2e.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Iconify.Fetcher.fetch_icons/2calledSet.get!/2for every requested name, so asking for an icon the set doesn't have raised.fetch_icon/2delegates to it, so it raised too, instead of returning{:error, :not_found}as documented. phoenix_iconify's end-to-end test for elixir-volt/phoenix_iconify#2 caught this.fetch_icons/2now returns only the icons the set has.This also gets master ready to publish:
json_codec ~> 0.3instead ofpath: "../json_codec", which came in with the unreleased JSONCodec parsing commits;fast_path:option, which failed--warnings-as-errors.Tests
End-to-end tests against the Iconify API live in
test/e2e/. They're tagged:e2e, excluded frommix test, and run withmix test.e2e:fetch_icons/2leaves out an unknown name;fetch_icon/2fetcheslucide:layer-arrow-upand reports an unknown name as not found.mix cipasses (34 tests), andmix test.e2epasses (2 tests).