nimblehq / elixir-templates

Our optimized Elixir templates used in our projects
https://nimblehq.co
MIT License
86 stars 6 forks source link

Do not allow the Test ENV call Hex.pm directly #284

Closed andyduong1920 closed 1 year ago

andyduong1920 commented 2 years ago

What happened 👀

Currently, if the developer forgets to mock the external library, our test will send a real request to Hex.pm to get the latest version this brings two issues

Related comment https://github.com/nimblehq/elixir-templates/pull/276/files#r1017442442

Insight 📝

Using different resources per each environment.

On the Test ENV, if we missed the @describetag mock_latest_package_versions: [{xx, yy}] our test won't pass.

Note

There is a workaround I'm not sure why that application environment is nil when we apply the template.

image

Proof Of Work 📹

1/ The test is pass 2/ Tested on my local

image

andyduong1920 commented 1 year ago

@byhbt can you have a look and merge this ;) https://github.com/nimblehq/elixir-templates/pull/284