TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Creating Your Own Fakes Instead of Using Mocking Libraries

1 pointsby freedudealmost 2 years ago

1 comment

freedudealmost 2 years ago
&quot; I want to explain some of the terms that fly around like fake, mock, shim or stub.<p><pre><code> Fake is a general term and can include stubs, mocks, and shims. Stub provides pre-set answers to calls. Mock checks interactions and provides pre-set answers. Shim diverts or changes the behavior of existing calls. </code></pre> &quot;<p>...<p>&quot; Creating your own fakes comes with a cost. You have to maintain them... &quot;