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

#20 Write tests for Client module #21

Merged
merged 1 commit into from
Apr 25, 2024
Merged

#20 Write tests for Client module #21

merged 1 commit into from
Apr 25, 2024

Conversation

gk-per
Copy link
Contributor

@gk-per gk-per commented Apr 24, 2024

What I'm doing:

  • write tests for client.ex module testing various response codes from API are handled correctly by client
  • add yecc and leex to compilers to fix 2 warnings

What it looks like:

*[cs/client-test][~/src/prodops_ex]$ mix test
....
Finished in 0.01 seconds (0.00s async, 0.01s sync)
4 tests, 0 failures

What I'd like feedback on:

  • What other modules should we be testing?

…m API are handled correctly by client

- add yecc and leex to compilers to fix 2 warnings
Copy link
Collaborator

@estreeper estreeper left a comment

Choose a reason for hiding this comment

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

I think this is a nice start!

To expand on testing in general, we may want to:

  • stub out the client functionality with some known-good and known-bad responses
  • make sure the stuff in prodops_ex.ex does the right thing

@@ -7,7 +7,8 @@ defmodule ProdopsEx.MixProject do
version: "0.1.0",
elixir: "~> 1.16",
start_permanent: Mix.env() == :prod,
deps: deps()
deps: deps(),
compilers: [:yecc, :leex] ++ Mix.compilers()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sweet, this was bugging me too

@gk-per gk-per merged commit 847e837 into main Apr 25, 2024
1 check passed
@estreeper estreeper deleted the cs/client-test branch May 3, 2024 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants