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

Add mock function into Timeout Task's process dictionary #237

Closed

Conversation

log4b
Copy link

@log4b log4b commented Aug 25, 2018

Hello! This is a proposal to fix #157.

I followed @stefanchrobot first suggestion and copied the mock inside Task process dictionary.

On the unit tests, I had to define another client since I couldn't figure out a way to reuse the existing one's for this test. Would appreciate any feedback on how to improve it :)

@codecov
Copy link

codecov bot commented Aug 25, 2018

Codecov Report

Merging #237 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #237      +/-   ##
==========================================
+ Coverage   95.65%   95.68%   +0.02%     
==========================================
  Files          23       23              
  Lines         460      463       +3     
==========================================
+ Hits          440      443       +3     
  Misses         20       20
Impacted Files Coverage Δ
lib/tesla/middleware/timeout.ex 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0bf4b03...3a0b903. Read the comment docs.

@teamon teamon mentioned this pull request Aug 29, 2018
3 tasks
@teamon
Copy link
Member

teamon commented Aug 29, 2018

Thanks for the PR!

The reason I did not implement this solution is that it is polluting production code with test-specific code. Please see #240 (point C) for the proposal on how to fix this issue.

@teamon teamon added the blocked label Aug 29, 2018
@log4b
Copy link
Author

log4b commented Sep 18, 2018

It makes totally sense. I'll take a closer look on #240. Closing for now. Thanks :)

@log4b log4b closed this Sep 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tesla.Mock not compatible with Tesla.Middleware.Timeout
2 participants