TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: How do you run integration tests involving third party HTTP services?

1 点作者 labarilem超过 1 年前
Some approaches that come to mind:<p>- Convert the integration test to a &quot;tighter&quot; unit test which completely mocks the external service, thus effectively not firing any HTTP request<p>- Run a proxy&#x2F;mock server intercepting all requests that responds with mock data, thus accepting and responding to HTTP requests. An example: https:&#x2F;&#x2F;mock-server.com<p>Most third party APIs do not provide a sandbox or a dry-run mode so this is a recurring topic.<p>I&#x27;m using Node.js so if you know of any node-specific tool, it&#x27;d be great!

1 comment

stop50超过 1 年前
For my own tools i use python-responses for mocking the api responses and i have an seperate tool to check if my api calls still work.