kubernetes / test-infra

Test infrastructure for the Kubernetes project.
Apache License 2.0
3.82k stars 2.64k forks source link

Mocking framework for unit testing #6665

Closed qhuynh96 closed 6 years ago

qhuynh96 commented 6 years ago

I would like to know if we are currently adopting to any mocking framework for unit tests in Go. I am writing unit tests for Deck and need to mock several methods that return key/token from Github OAuth API

BenTheElder commented 6 years ago

In go you can just use an interface with fake and real implementations for pretty much all unit testing needs.

On Mon, Feb 5, 2018, 22:46 Quang Huynh notifications@github.com wrote:

I would like to know if we are currently adopting to any mocking framework for unit tests in Go. I am writing unit tests for Deck and need to mock several methods that return key/token from Github OAuth API

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kubernetes/test-infra/issues/6665, or mute the thread https://github.com/notifications/unsubscribe-auth/AA4Bq1jMCmFmF0m-kQ__qI_5o-y8imJiks5tR_VAgaJpZM4R6kq7 .

qhuynh96 commented 6 years ago

Got it! Thanks /close