Skip to content

syepesc/elixir_testable_http_api_client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Elixir Testable HTTP API Client

The intent of this repo is to practice my Elixir knowledge by making use of the GitHub API.

Special thanks to the authors of the amazing doc Creating testable HTTP API client code in Elixir.

Concepts applied:

  • Elixir behaviors using Knigge.
  • HTTP requests using Req.
  • Elixir testing using Mox.

What to expect when running the app?

This is an app that only work trough commands typed in the terminal after running it using iex. To have an idea of what the app does start reading lib/elixir_testable_http_api_client/repo_contest.ex.

How to run the project?

  • Install mise (previously rtx) , cd into the project directory and run:
mise install
  • cd into the project directory and run:
mix deps.get
  • Compile and start the project by running:
iex -S mix
  • Play around with the repo contest functionality by running:
ElixirTestableHttpApiClient.GithubApi.get_repos_for_org("elixir-lang")

OR

ElixirTestableHttpApiClient.RepoContest.head_to_head("org-1", "org-2")

Remember to change org-1 and org-2 to the GitHub orgs you want to compare.

How to run the test suite of the project?

  • cd into the project directory and run:
mix test

About

Good practices using behaviours, requests and testing in Elixir

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages