News for hackers. Stuff that matters.
Re:Ask HN: Best Way to Mock APIs in 2020? by djohnston on Sunday June 14, 2020 @08:31AM (#23517215)
What does mocking an interface mean, like a mock implementation?

How is that different then defining an API and then having stub methods on the front returning pretend data?

Re:Ask HN: Best Way to Mock APIs in 2020? by gitgud on Sunday June 14, 2020 @07:16PM (#23522274)
I think they mean wrapping the REST api in a class (aka "data provider" or "repository pattern") this way you've abstracted the HTTP request logic away from your application.

Both the API and the Mock implementation will require the same interface.