# mock api

Mock API is a technique for simulating API behavior and responses for development and testing before or without a working backend.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Best API Testing Tools for AI Agents in 2026

DevFeed: [Best API Testing Tools for AI Agents in 2026](<https://devfeed.tech/articles/best-api-testing-tools-for-ai-agents-in-2026-148332.md>)

Original publisher: [Read original article](<https://www.swytchcode.com/content/best-api-testing-tools-for-ai-agents-in-2026>)

Author: Swytchcode Team

Published: 2026-11-20T09:00:00Z

Content type: comparison

Language: en

Sources: [Swytchcode](<https://devfeed.tech/sources/swytchcode.md>)

Topics: [Postman](<https://devfeed.tech/topics/postman.md>), [Test automation](<https://devfeed.tech/topics/test-automation.md>), [Playwright](<https://devfeed.tech/topics/playwright.md>), [Swagger](<https://devfeed.tech/topics/swagger.md>), [mock api](<https://devfeed.tech/topics/mock-api.md>)

Tags: [2](<https://devfeed.tech/tags/2.md>), [2026](<https://devfeed.tech/tags/2026.md>), [3](<https://devfeed.tech/tags/3.md>), [about](<https://devfeed.tech/tags/about.md>), [adyen](<https://devfeed.tech/tags/adyen.md>), [agent](<https://devfeed.tech/tags/agent.md>), [agents](<https://devfeed.tech/tags/agents.md>), [ai](<https://devfeed.tech/tags/ai.md>), [ai-agent](<https://devfeed.tech/tags/ai-agent.md>), [ai-agent-api-execution](<https://devfeed.tech/tags/ai-agent-api-execution.md>), [ai-agent-api-integration-platform](<https://devfeed.tech/tags/ai-agent-api-integration-platform.md>), [ai-agents](<https://devfeed.tech/tags/ai-agents.md>), [api](<https://devfeed.tech/tags/api.md>), [api-testing](<https://devfeed.tech/tags/api-testing.md>), [apis](<https://devfeed.tech/tags/apis.md>), [best](<https://devfeed.tech/tags/best.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [rank](<https://devfeed.tech/tags/rank.md>), [swytchcode](<https://devfeed.tech/tags/swytchcode.md>), [test](<https://devfeed.tech/tags/test.md>), [testing](<https://devfeed.tech/tags/testing.md>), [testing-tools](<https://devfeed.tech/tags/testing-tools.md>), [tool-calling-runtime](<https://devfeed.tech/tags/tool-calling-runtime.md>), [tools](<https://devfeed.tech/tags/tools.md>), [using](<https://devfeed.tech/tags/using.md>)

### AI overview

The key finding is that API testing for agent-called APIs has different blind spots depending on its source of truth. Captured-traffic tools such as Keploy and Postman's AI test generator are quick to set up and useful for replaying regressions, but old captures can pass even after a provider changes its schema. Live-spec approaches such as Pact and Speakeasy can expose drift against current contracts; Pact verifies consumer expectations against provider behavior in CI, while Speakeasy's schema-driven SDK generation is architectural rather than a dedicated testing feature. Hoppscotch, Playwright, and Supertest leave assertions to users. The article says none of these tools validate each production call at runtime: it presents Swytchcode's request schema and response-body checks as a separate layer for changes between CI runs and live calls. It recommends covering both pre-deploy drift and runtime behavior, while noting the comparison was based on vendor information rather than end-to-end tool tests.

### Source excerpt

We rank the API testing tools worth using for AI-agent-called APIs, and why most of them test against yesterday, not today.

## Best API Testing Tools for AI Agents

DevFeed: [Best API Testing Tools for AI Agents](<https://devfeed.tech/articles/best-api-testing-tools-for-ai-agents-146948.md>)

Original publisher: [Read original article](<https://www.swytchcode.com/content/best-api-testing-tools-ai-agents>)

Author: Swytchcode Team

Published: 2026-11-20T09:00:00Z

Content type: comparison

Language: en

Sources: [Swytchcode](<https://devfeed.tech/sources/swytchcode.md>)

Topics: [Test automation](<https://devfeed.tech/topics/test-automation.md>), [Postman](<https://devfeed.tech/topics/postman.md>), [Playwright](<https://devfeed.tech/topics/playwright.md>), [mock api](<https://devfeed.tech/topics/mock-api.md>)

Tags: [agent-testing](<https://devfeed.tech/tags/agent-testing.md>), [agents](<https://devfeed.tech/tags/agents.md>), [ai](<https://devfeed.tech/tags/ai.md>), [ai-agents](<https://devfeed.tech/tags/ai-agents.md>), [ai-generated-tests](<https://devfeed.tech/tags/ai-generated-tests.md>), [apache-2-0](<https://devfeed.tech/tags/apache-2-0.md>), [api](<https://devfeed.tech/tags/api.md>), [api-governance](<https://devfeed.tech/tags/api-governance.md>), [api-platform](<https://devfeed.tech/tags/api-platform.md>), [api-testing](<https://devfeed.tech/tags/api-testing.md>), [assertions](<https://devfeed.tech/tags/assertions.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [testing](<https://devfeed.tech/tags/testing.md>), [testing-tools](<https://devfeed.tech/tags/testing-tools.md>), [tools](<https://devfeed.tech/tags/tools.md>)

### AI overview

API testing tools differ in what they treat as correct: live-spec approaches can catch provider schema changes on the next run, while captured-traffic tools replay past behavior and are effective at finding regressions in an application but may miss changes absent from the capture. The excerpt describes Postman's AI test generation as response-driven, alongside separate spec-governance features; Speakeasy's SDK generation as OpenAPI-driven; Pact as consumer-driven contracts verified against provider behavior in CI; and Keploy as traffic replay with optional schema-generated edge cases. Hoppscotch, Playwright, and Supertest leave assertions to users, with Playwright and Supertest integrating into CI. The text says none runs validation at live call time: it presents runtime request-schema and response-body checks as a separate layer for changes or failures arising after tests. It recommends covering both pre-deploy drift and runtime calls, while noting that the tools were not tested end to end and some pricing or product scope should be confirmed.

### Source excerpt

We rank the API testing tools worth using for AI-agent-called APIs, and why most of them test against yesterday, not today.

## Preventing API Contract Drift in TypeScript Applications

DevFeed: [Preventing API Contract Drift in TypeScript Applications](<https://devfeed.tech/articles/preventing-api-contract-drift-in-typescript-applications-134432.md>)

Original publisher: [Read original article](<https://www.sitepoint.com/preventing-api-contract-drift-in-typescript-applications/>)

Author: Saifullah Adenwalla

Published: 2026-11-13T13:48:49Z

Content type: tutorial

Language: en

Sources: [SitePoint](<https://devfeed.tech/sources/sitepoint.md>)

Topics: [API](<https://devfeed.tech/topics/api.md>), [TypeScript](<https://devfeed.tech/topics/typescript.md>), [schema design](<https://devfeed.tech/topics/schema-design.md>), [Swagger](<https://devfeed.tech/topics/swagger.md>), [mock api](<https://devfeed.tech/topics/mock-api.md>), [CI/CD](<https://devfeed.tech/topics/cicd.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>)

Tags: [accessibility](<https://devfeed.tech/tags/accessibility.md>), [agile-development](<https://devfeed.tech/tags/agile-development.md>), [api](<https://devfeed.tech/tags/api.md>), [api-design](<https://devfeed.tech/tags/api-design.md>), [api-documentation](<https://devfeed.tech/tags/api-documentation.md>), [api-integration](<https://devfeed.tech/tags/api-integration.md>), [apis](<https://devfeed.tech/tags/apis.md>), [ci-cd](<https://devfeed.tech/tags/ci-cd.md>), [code-generation](<https://devfeed.tech/tags/code-generation.md>), [contract-testing](<https://devfeed.tech/tags/contract-testing.md>), [contracts](<https://devfeed.tech/tags/contracts.md>), [data-structure](<https://devfeed.tech/tags/data-structure.md>), [data-types](<https://devfeed.tech/tags/data-types.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [typescript](<https://devfeed.tech/tags/typescript.md>), [ui-design](<https://devfeed.tech/tags/ui-design.md>)

### AI overview

TypeScript interfaces do not verify JSON received over HTTP, so a frontend can compile while silently receiving data that no longer matches its expectations. The excerpt recommends validating responses at the application boundary with Zod schemas, treating fetched data as unknown and using parse or safeParse; deriving types from schemas avoids maintaining duplicate definitions. It distinguishes this runtime check from OpenAPI, which documents a shared service contract, and Orval, which generates TypeScript clients and types from that specification but does not itself validate runtime responses. MSW can provide controlled success and failure responses for frontend development and tests without a live backend; Pact verifies consumer expectations against provider behavior. The excerpt also recommends automating contract validation and tests in CI/CD and assigning API ownership as teams grow. It presents these as complementary options to adopt according to architecture, rather than requiring every tool.

### Source excerpt

null Continue reading Preventing API Contract Drift in TypeScript Applications on SitePoint.

## Postman Plugin for Claude Code: A Hands-On Guide

DevFeed: [Postman Plugin for Claude Code: A Hands-On Guide](<https://devfeed.tech/articles/postman-plugin-for-claude-code-a-hands-on-guide-125770.md>)

Original publisher: [Read original article](<https://blog.postman.com/postman-plugin-for-claude-code-a-hands-on-guide/>)

Author: Quinton Wall

Published: 2026-11-09T16:00:00Z

Content type: tutorial

Language: en

Sources: [Postman](<https://devfeed.tech/sources/postman-blog.md>)

Topics: [Claude Code](<https://devfeed.tech/topics/claude-code.md>), [Postman](<https://devfeed.tech/topics/postman.md>), [OpenAPI Specification](<https://devfeed.tech/topics/openapi.md>), [Postman CLI](<https://devfeed.tech/topics/postman-cli.md>), [CI/CD](<https://devfeed.tech/topics/cicd.md>), [mock api](<https://devfeed.tech/topics/mock-api.md>), [Loop Engineering](<https://devfeed.tech/topics/loop-engineering.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>), [Spec Driven Development](<https://devfeed.tech/topics/spec-driven-development.md>), [hooks](<https://devfeed.tech/topics/hooks.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [ai-agents](<https://devfeed.tech/tags/ai-agents.md>), [ai-native](<https://devfeed.tech/tags/ai-native.md>), [api](<https://devfeed.tech/tags/api.md>), [blog](<https://devfeed.tech/tags/blog.md>), [build](<https://devfeed.tech/tags/build.md>), [claude](<https://devfeed.tech/tags/claude.md>), [claude-code](<https://devfeed.tech/tags/claude-code.md>), [code](<https://devfeed.tech/tags/code.md>), [copy](<https://devfeed.tech/tags/copy.md>), [editor-s-picks](<https://devfeed.tech/tags/editor-s-picks.md>), [editors-recommendations](<https://devfeed.tech/tags/editors-recommendations.md>), [first](<https://devfeed.tech/tags/first.md>), [gate](<https://devfeed.tech/tags/gate.md>), [general](<https://devfeed.tech/tags/general.md>), [guide](<https://devfeed.tech/tags/guide.md>), [hooks](<https://devfeed.tech/tags/hooks.md>), [install](<https://devfeed.tech/tags/install.md>), [mock](<https://devfeed.tech/tags/mock.md>), [native](<https://devfeed.tech/tags/native.md>), [openapi](<https://devfeed.tech/tags/openapi.md>), [plugin](<https://devfeed.tech/tags/plugin.md>), [post](<https://devfeed.tech/tags/post.md>), [postman](<https://devfeed.tech/tags/postman.md>), [postman-plugin](<https://devfeed.tech/tags/postman-plugin.md>)

### AI overview

The Postman plugin for Claude Code routes API work through Postman CLI skills, from discovery and contract design to mocks, tests, readiness scoring, and CI checks. The guide recommends keeping an OpenAPI spec and v3 collection in the repository, linting changes, and using a deterministic CI gate; local lint, mock, and collection commands do not require Postman sign-in, while cloud features do. Discovery searches Postman resources by ownership scope, Orbit finds third-party provider candidates but does not supply credentials, and Context Graph can identify endpoint consumers but not which fields they use. Mocks can exercise failure cases, though they do not prove the implementation works and do not hot-reload. Claude Code plan mode, hooks, subagents, and bounded `/goal` loops can make the process more repeatable; token and turn limits help constrain loops. The guide also cautions that CLI flags vary by version and some commands report results or analytics to Postman by default.

### Source excerpt

Install the Postman plugin for Claude Code, then build, mock, test, and gate an AI-native API with copy-paste prompts, hooks, and /goal. The post Postman Plugin for Claude Code: A Hands-On Guide appeared first on Postman Blog.

## I broke a working agent seven ways. The metric I was watching caught two of them.

DevFeed: [I broke a working agent seven ways. The metric I was watching caught two of them.](<https://devfeed.tech/articles/i-broke-a-working-agent-seven-ways-the-metric-i-was-watching-caught-two-of-them-119287.md>)

Original publisher: [Read original article](<https://thenewstack.io/monitoring-production-ai-agents/>)

Author: Kayode Ojo

Published: 2026-11-05T15:00:00Z

Content type: news

Language: en

Sources: [The New Stack](<https://devfeed.tech/sources/the-new-stack.md>)

Topics: [AI Agent](<https://devfeed.tech/topics/ai-agent.md>), [AI Infrastructure](<https://devfeed.tech/topics/ai-infrastructure.md>), [Claude](<https://devfeed.tech/topics/claude.md>), [mock api](<https://devfeed.tech/topics/mock-api.md>)

Tags: [adversarial](<https://devfeed.tech/tags/adversarial.md>), [agent](<https://devfeed.tech/tags/agent.md>), [ai-agents](<https://devfeed.tech/tags/ai-agents.md>), [andela](<https://devfeed.tech/tags/andela.md>), [anomaly-detection](<https://devfeed.tech/tags/anomaly-detection.md>), [api](<https://devfeed.tech/tags/api.md>), [api-documentation](<https://devfeed.tech/tags/api-documentation.md>), [arm](<https://devfeed.tech/tags/arm.md>), [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [audit](<https://devfeed.tech/tags/audit.md>), [authorization](<https://devfeed.tech/tags/authorization.md>), [autonomous](<https://devfeed.tech/tags/autonomous.md>), [behavior](<https://devfeed.tech/tags/behavior.md>), [benchmark](<https://devfeed.tech/tags/benchmark.md>), [billing](<https://devfeed.tech/tags/billing.md>), [claude](<https://devfeed.tech/tags/claude.md>), [claude-haiku-5-5](<https://devfeed.tech/tags/claude-haiku-5-5.md>), [metric](<https://devfeed.tech/tags/metric.md>), [models](<https://devfeed.tech/tags/models.md>), [observability](<https://devfeed.tech/tags/observability.md>), [post-contributed](<https://devfeed.tech/tags/post-contributed.md>), [software-testing](<https://devfeed.tech/tags/software-testing.md>), [sponsor-andela](<https://devfeed.tech/tags/sponsor-andela.md>), [sponsored-post-contributed](<https://devfeed.tech/tags/sponsored-post-contributed.md>), [support](<https://devfeed.tech/tags/support.md>), [tasks](<https://devfeed.tech/tags/tasks.md>)

### AI overview

In a 19-task support-agent benchmark with two refund traps, completion scores missed most injected failures: only two of seven active regressions lowered task success below threshold. Tool-call volume and scope drift each detected four, while token cost detected one and refund traps detected none. Retries and workarounds masked flaky APIs and missing documentation; stale replica reads left every quantitative metric green, though the agent disclosed the issue in its final summary. The author recommends logging the resolved model ID, tracking tool calls per verified task and retries, parsing uncertainty in agent summaries, and refreshing adversarial tests after model updates. In this setup, baseline tool-call variance was 3% versus 18% for tokens, enabling tighter call-volume alerts. The benchmark is one system and its thresholds derive from three baseline runs.

### Source excerpt

In September, I ran two models through the same 20 support tasks. Both scored 20 out of 20. Then I The post I broke a working agent seven ways. The metric I was watching caught two of them. appeared first on The New Stack.

## Mocking Dependencies for Local Development

DevFeed: [Mocking Dependencies for Local Development](<https://devfeed.tech/articles/mocking-dependencies-for-local-development-107479.md>)

Original publisher: [Read original article](<https://blog.postman.com/mocking-dependencies-for-local-development/>)

Author: Talia Kohan

Published: 2026-10-29T15:00:06Z

Content type: tutorial

Language: en

Sources: [Postman](<https://devfeed.tech/sources/postman-blog.md>)

Topics: [mock api](<https://devfeed.tech/topics/mock-api.md>), [Mocking](<https://devfeed.tech/topics/mocking.md>), [developer setup](<https://devfeed.tech/topics/developer-setup.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [api-discovery](<https://devfeed.tech/tags/api-discovery.md>), [api-mocking](<https://devfeed.tech/tags/api-mocking.md>), [api-testing](<https://devfeed.tech/tags/api-testing.md>), [calendar](<https://devfeed.tech/tags/calendar.md>), [claude](<https://devfeed.tech/tags/claude.md>), [claude-code](<https://devfeed.tech/tags/claude-code.md>), [cloud](<https://devfeed.tech/tags/cloud.md>), [collections](<https://devfeed.tech/tags/collections.md>), [context-graph](<https://devfeed.tech/tags/context-graph.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [dependency](<https://devfeed.tech/tags/dependency.md>), [development](<https://devfeed.tech/tags/development.md>), [general](<https://devfeed.tech/tags/general.md>), [local](<https://devfeed.tech/tags/local.md>), [local-development](<https://devfeed.tech/tags/local-development.md>), [mock](<https://devfeed.tech/tags/mock.md>), [mock-servers](<https://devfeed.tech/tags/mock-servers.md>), [mocking](<https://devfeed.tech/tags/mocking.md>), [postman](<https://devfeed.tech/tags/postman.md>), [repo](<https://devfeed.tech/tags/repo.md>)

### AI overview

The walkthrough shows how Postman's Context Graph and Claude Code plugin can set up local mocks across a service dependency chain. The api-discovery skill finds integrations, endpoints and schemas, including a service in another repository that a local code search would miss. The api-mocking skill creates Git-backed Local Mock Servers under `postman/mocks/`, with scenario configuration and JavaScript handlers; environment variables point each service to the mock's localhost port without gateway code changes. The api-testing skill checks responses and failure scenarios such as 401, 404 and 422. Discovery expanded the setup from five gateway integrations to seven mocks covering two additional services' call patterns. Committing the mock files and environment wiring makes the setup reproducible across clones and repositories. The article cautions that local mocks do not replace testing against real services before release.

### Source excerpt

Mock every dependency a service calls, even ones outside your repo, using Postman's Context Graph and Local Mock Servers. The post Mocking Dependencies for Local Development appeared first on Postman Blog.

## 7 Ways to Keep API Changes Safe as More Teams Join a Project

DevFeed: [7 Ways to Keep API Changes Safe as More Teams Join a Project](<https://devfeed.tech/articles/7-ways-to-keep-api-changes-safe-as-more-teams-join-a-project-102775.md>)

Original publisher: [Read original article](<https://www.sitepoint.com/7-ways-to-keep-api-changes-safe-as-more-teams-join-a-project/>)

Author: Saifullah Adenwalla

Published: 2026-10-27T11:05:30Z

Content type: article

Language: en

Sources: [SitePoint](<https://devfeed.tech/sources/sitepoint.md>)

Topics: [API](<https://devfeed.tech/topics/api.md>), [REST API](<https://devfeed.tech/topics/rest-api.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>), [Test automation](<https://devfeed.tech/topics/test-automation.md>), [versioning](<https://devfeed.tech/topics/versioning.md>), [Pull Request](<https://devfeed.tech/topics/pull-request.md>), [deprecated](<https://devfeed.tech/topics/deprecated.md>), [mock api](<https://devfeed.tech/topics/mock-api.md>), [CI/CD](<https://devfeed.tech/topics/cicd.md>), [API Logging](<https://devfeed.tech/topics/api-logging.md>)

Tags: [2](<https://devfeed.tech/tags/2.md>), [3](<https://devfeed.tech/tags/3.md>), [adapter](<https://devfeed.tech/tags/adapter.md>), [ai](<https://devfeed.tech/tags/ai.md>), [all](<https://devfeed.tech/tags/all.md>), [allows](<https://devfeed.tech/tags/allows.md>), [also](<https://devfeed.tech/tags/also.md>), [api](<https://devfeed.tech/tags/api.md>), [api-best-practices](<https://devfeed.tech/tags/api-best-practices.md>), [apis](<https://devfeed.tech/tags/apis.md>), [app](<https://devfeed.tech/tags/app.md>), [application](<https://devfeed.tech/tags/application.md>), [applications](<https://devfeed.tech/tags/applications.md>), [apply](<https://devfeed.tech/tags/apply.md>), [array](<https://devfeed.tech/tags/array.md>), [changes](<https://devfeed.tech/tags/changes.md>), [html-css](<https://devfeed.tech/tags/html-css.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [join](<https://devfeed.tech/tags/join.md>), [keep](<https://devfeed.tech/tags/keep.md>), [node-js](<https://devfeed.tech/tags/node-js.md>), [null](<https://devfeed.tech/tags/null.md>), [project](<https://devfeed.tech/tags/project.md>), [teams](<https://devfeed.tech/tags/teams.md>)

### AI overview

An API field rename can break clients even when the provider deploys successfully, so the excerpt recommends making dependencies and compatibility decisions explicit. Document the contract and its field meanings in a versioned OpenAPI description; inventory consumers and their upgrade timelines, including infrequent jobs and strict decoders. For a rename, return both fields from the same source, migrate consumers, and remove the old field only after supported versions are verified against a compatibility policy. Test client fallback behavior, while recognizing adapter tests do not prove live API behavior; add boundary integration coverage. Lint and compare the API description against the released baseline, run consumer tests, and verify provider behavior, since these checks answer different questions. Assign interface ownership, record migration and rollback steps, monitor rollout errors without logging sensitive payloads, and retire compatibility code deliberately. External API removal may require versioning or deprecation, and rollback can break consumers that already require the new field.

### Source excerpt

null Continue reading 7 Ways to Keep API Changes Safe as More Teams Join a Project on SitePoint.

## MyClaw runs every tool without asking. Here's how to keep its API calls in bounds.

DevFeed: [MyClaw runs every tool without asking. Here's how to keep its API calls in bounds.](<https://devfeed.tech/articles/myclaw-runs-every-tool-without-asking-here-s-how-to-keep-its-api-calls-in-bounds-96062.md>)

Original publisher: [Read original article](<https://www.swytchcode.com/content/myclaw-runs-every-tool-without-asking-here-s-how-to-keep-its-api-calls-in-bounds>)

Author: Swytchcode Team

Published: 2026-10-21T10:20:09Z

Content type: tutorial

Language: en

Sources: [Swytchcode](<https://devfeed.tech/sources/swytchcode.md>)

Topics: [API Governance](<https://devfeed.tech/topics/api-governance.md>), [Agent Harness](<https://devfeed.tech/topics/agent-harness.md>), [out-of-process](<https://devfeed.tech/topics/out-of-process.md>), [telegram-bot](<https://devfeed.tech/topics/telegram-bot.md>), [mock api](<https://devfeed.tech/topics/mock-api.md>)

Tags: [2](<https://devfeed.tech/tags/2.md>), [3](<https://devfeed.tech/tags/3.md>), [account](<https://devfeed.tech/tags/account.md>), [agent](<https://devfeed.tech/tags/agent.md>), [agents](<https://devfeed.tech/tags/agents.md>), [ai](<https://devfeed.tech/tags/ai.md>), [ai-agent](<https://devfeed.tech/tags/ai-agent.md>), [all](<https://devfeed.tech/tags/all.md>), [api](<https://devfeed.tech/tags/api.md>), [authorization](<https://devfeed.tech/tags/authorization.md>), [call](<https://devfeed.tech/tags/call.md>), [customer](<https://devfeed.tech/tags/customer.md>), [here](<https://devfeed.tech/tags/here.md>), [here-s](<https://devfeed.tech/tags/here-s.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [keep](<https://devfeed.tech/tags/keep.md>), [refunds](<https://devfeed.tech/tags/refunds.md>), [rules](<https://devfeed.tech/tags/rules.md>), [stop](<https://devfeed.tech/tags/stop.md>), [tool](<https://devfeed.tech/tags/tool.md>)

### AI overview

In tests with MyClaw 0.6.2 and a mocked Stripe, all seven checks passed after configuring Swytchcode to require approval for writes and locking down MyClaw's other tools. Run Swytchcode as an HTTP server and use `http+streamable://`; a local command exits after connection, while plain `http://` selects the older SSE transport. The `restrictToWorkspace` setting was not enforced, and `~` in deny rules matched nothing. The tested setup uses full paths, denies Bash, Grep and Glob, blocks file access to Swytchcode credentials and project files, and prevents edits to MyClaw's own settings. The authors recommend testing that protected files are actually inaccessible before connecting a real account. Tests used a scripted model and mocked Stripe; real models, chat channels and approvals remain untested.

### Source excerpt

MyClaw runs every tool without asking, including the API call that refunds a customer. Here's how to add Swytchcode so writes wait for your approval, and the lock-down rules that stop MyClaw from editing its own rules.

## How to Mock AWS SDK v3 in Vitest Without Extra Dependencies

DevFeed: [How to Mock AWS SDK v3 in Vitest Without Extra Dependencies](<https://devfeed.tech/articles/how-to-mock-aws-sdk-v3-in-vitest-without-extra-dependencies-92541.md>)

Original publisher: [Read original article](<https://hackernoon.com/how-to-mock-aws-sdk-v3-in-vitest-without-extra-dependencies?source=rss>)

Author: Lucas Tonelli

Published: 2026-10-21T08:16:43Z

Content type: tutorial

Language: en

Sources: [HackerNoon](<https://devfeed.tech/sources/hackernoon.md>)

Topics: [Mocking](<https://devfeed.tech/topics/mocking.md>), [mock api](<https://devfeed.tech/topics/mock-api.md>), [Amazon Web Services](<https://devfeed.tech/topics/aws.md>), [SDK](<https://devfeed.tech/topics/sdk.md>)

Tags: [2](<https://devfeed.tech/tags/2.md>), [3](<https://devfeed.tech/tags/3.md>), [agent](<https://devfeed.tech/tags/agent.md>), [ai](<https://devfeed.tech/tags/ai.md>), [approach](<https://devfeed.tech/tags/approach.md>), [aws](<https://devfeed.tech/tags/aws.md>), [aws-sdk](<https://devfeed.tech/tags/aws-sdk.md>), [aws-sdk-client-mock](<https://devfeed.tech/tags/aws-sdk-client-mock.md>), [but](<https://devfeed.tech/tags/but.md>), [can](<https://devfeed.tech/tags/can.md>), [client](<https://devfeed.tech/tags/client.md>), [clients](<https://devfeed.tech/tags/clients.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [extra](<https://devfeed.tech/tags/extra.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [mock](<https://devfeed.tech/tags/mock.md>), [mocking-aws-clients](<https://devfeed.tech/tags/mocking-aws-clients.md>), [need](<https://devfeed.tech/tags/need.md>), [nodejs](<https://devfeed.tech/tags/nodejs.md>), [sdk](<https://devfeed.tech/tags/sdk.md>), [tests](<https://devfeed.tech/tags/tests.md>), [typescript-unit-testing](<https://devfeed.tech/tags/typescript-unit-testing.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>), [v3](<https://devfeed.tech/tags/v3.md>), [vitest-interceptors](<https://devfeed.tech/tags/vitest-interceptors.md>), [with](<https://devfeed.tech/tags/with.md>)

### AI overview

The excerpt shows how to mock AWS SDK v3 clients using Vitest without an extra mocking package: replace a service client's constructor with a fake that exposes a `send` method backed by `vi.fn()`, while retaining the SDK's real exports so commands remain genuine. Put the `vi.mock` setup in Vitest `setupFiles` when clients are constructed at module scope. Tests can queue responses with one shot resolved or rejected values, or use service specific helpers for defaults and overrides, then assert both request input and command class. Reset the send mock between tests, using Vitest cleanup settings where suitable. Give each AWS service its own mock to avoid response collisions. The excerpt describes `aws-sdk-client-mock` as offering a compact command oriented API, while requiring its own mock/reset approach and extra matchers for command assertions.

### Source excerpt

You need to mock AWS SDK clients in your tests, but the traditional approach with aws-sdk-client-mock requires special treatment and can be cumbersome.

## Can AI Do API Testing? What Works and What Doesn't

DevFeed: [Can AI Do API Testing? What Works and What Doesn't](<https://devfeed.tech/articles/can-ai-do-api-testing-what-works-and-what-doesn-t-90681.md>)

Original publisher: [Read original article](<https://www.swytchcode.com/content/ai-api-testing>)

Author: Swytchcode Team

Published: 2026-10-16T04:45:00Z

Content type: article

Language: en

Sources: [Swytchcode](<https://devfeed.tech/sources/swytchcode.md>)

Topics: [Test automation](<https://devfeed.tech/topics/test-automation.md>), [API](<https://devfeed.tech/topics/api.md>), [mock api](<https://devfeed.tech/topics/mock-api.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [api](<https://devfeed.tech/tags/api.md>), [api-testing](<https://devfeed.tech/tags/api-testing.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [testing](<https://devfeed.tech/tags/testing.md>)

### AI overview

AI can help generate API test cases from a real operation schema, but it cannot supply the API contract or reliably judge its own guesses. The article recommends checking response bodies against schemas or captured fixtures, covering failure cases such as retries and idempotency, and keeping generated tests aligned with the API version and client. A passing suite only shows that the selected cases matched their assertions in the tested environment.

### Source excerpt

AI can generate API tests from a schema you hand it. It cannot invent the contract, grade itself against that invention, and call the result coverage.

## How to test agent experience changes without shipping them

DevFeed: [How to test agent experience changes without shipping them](<https://devfeed.tech/articles/how-to-test-agent-experience-changes-without-shipping-them-23830.md>)

Original publisher: [Read original article](<https://devblogs.microsoft.com/blog/how-to-test-agent-experience-changes-without-shipping-them/>)

Author: Waldek Mastykarz, Garry Trinder

Published: 2026-07-21T07:15:12Z

Content type: article

Language: en

Sources: [Developer Blogs](<https://devfeed.tech/sources/developer-blogs.md>)

Topics: [product-experimentation](<https://devfeed.tech/topics/product-experimentation.md>), [agent observability](<https://devfeed.tech/topics/agent-observability.md>), [mock api](<https://devfeed.tech/topics/mock-api.md>), [Documentation](<https://devfeed.tech/topics/documentation.md>), [Model Context Protocol](<https://devfeed.tech/topics/model-context-protocol.md>), [MSP MCP](<https://devfeed.tech/topics/msp-mcp.md>), [Release notes](<https://devfeed.tech/topics/release-notes.md>)

Tags: [agent](<https://devfeed.tech/tags/agent.md>), [agent-experience](<https://devfeed.tech/tags/agent-experience.md>), [ai](<https://devfeed.tech/tags/ai.md>), [api](<https://devfeed.tech/tags/api.md>), [ax](<https://devfeed.tech/tags/ax.md>), [behavior](<https://devfeed.tech/tags/behavior.md>), [can](<https://devfeed.tech/tags/can.md>), [changes](<https://devfeed.tech/tags/changes.md>), [documentation](<https://devfeed.tech/tags/documentation.md>), [experience](<https://devfeed.tech/tags/experience.md>), [first](<https://devfeed.tech/tags/first.md>), [learn](<https://devfeed.tech/tags/learn.md>), [mcp](<https://devfeed.tech/tags/mcp.md>), [mcp-server](<https://devfeed.tech/tags/mcp-server.md>), [microsoft](<https://devfeed.tech/tags/microsoft.md>), [production](<https://devfeed.tech/tags/production.md>), [project](<https://devfeed.tech/tags/project.md>), [server](<https://devfeed.tech/tags/server.md>), [shipping](<https://devfeed.tech/tags/shipping.md>), [test](<https://devfeed.tech/tags/test.md>), [upgrade](<https://devfeed.tech/tags/upgrade.md>), [works](<https://devfeed.tech/tags/works.md>)

### AI overview

In an SPFx upgrade scenario, documentation tips recommending a CLI were ignored across runs, while a warning that the agent's existing approach would cause build failures led it to use the CLI in all five runs. Other tests found that removing a competing migration guide reduced dependency accuracy from 34/50 to 18/50; structured JSON improved configuration correctness from 72/85 to 85/85, while JSONL cost 2.6 times more tokens and performed worse across dimensions; PowerShell examples harmed idiomatic code quality, and an explicit script was not executed in any of ten runs. The post recommends testing such hypotheses before shipping by intercepting agent requests and returning modified responses locally. It used Dev Proxy to emulate Microsoft Learn page changes and says the same approach can test MCP response formats. The described benefit is faster iteration--minutes rather than days--so teams can measure many hypotheses and ship changes that improve results.

### Source excerpt

Most changes you think will improve AI agent behavior won't. We tested a dozen hypotheses on a real project upgrade scenario and the majority failed. Learn how to emulate documentation, API, and MCP server changes locally so you can validate what works before shipping anything to production. The post How to test agent experience changes without shipping them appeared first on Microsoft for Developers.

## How to test agent skills without hitting real APIs

DevFeed: [How to test agent skills without hitting real APIs](<https://devfeed.tech/articles/how-to-test-agent-skills-without-hitting-real-apis-23831.md>)

Original publisher: [Read original article](<https://devblogs.microsoft.com/blog/how-to-test-agent-skills-without-hitting-real-apis/>)

Author: Waldek Mastykarz

Published: 2026-07-17T09:27:50Z

Content type: article

Language: en

Sources: [Developer Blogs](<https://devfeed.tech/sources/developer-blogs.md>)

Topics: [Agent Skills](<https://devfeed.tech/topics/agent-skills.md>), [mock api](<https://devfeed.tech/topics/mock-api.md>), [Software Testing](<https://devfeed.tech/topics/software-testing.md>), [Test automation](<https://devfeed.tech/topics/test-automation.md>), [Mocking](<https://devfeed.tech/topics/mocking.md>)

Tags: [agent](<https://devfeed.tech/tags/agent.md>), [agent-experience](<https://devfeed.tech/tags/agent-experience.md>), [agent-skill](<https://devfeed.tech/tags/agent-skill.md>), [agent-skills](<https://devfeed.tech/tags/agent-skills.md>), [ai](<https://devfeed.tech/tags/ai.md>), [api](<https://devfeed.tech/tags/api.md>), [apis](<https://devfeed.tech/tags/apis.md>), [ax](<https://devfeed.tech/tags/ax.md>), [costs](<https://devfeed.tech/tags/costs.md>), [data](<https://devfeed.tech/tags/data.md>), [developers](<https://devfeed.tech/tags/developers.md>), [effect](<https://devfeed.tech/tags/effect.md>), [evals](<https://devfeed.tech/tags/evals.md>), [for-developers](<https://devfeed.tech/tags/for-developers.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [learn-how-to](<https://devfeed.tech/tags/learn-how-to.md>), [microsoft-for-developers](<https://devfeed.tech/tags/microsoft-for-developers.md>), [mock](<https://devfeed.tech/tags/mock.md>), [money](<https://devfeed.tech/tags/money.md>), [production](<https://devfeed.tech/tags/production.md>), [run](<https://devfeed.tech/tags/run.md>), [skills](<https://devfeed.tech/tags/skills.md>), [test](<https://devfeed.tech/tags/test.md>)

### AI overview

Evaluating API-calling agent skills against real services can incur call costs, mutate live data, and produce inconsistent results when outside changes affect shared state. The excerpt contrasts manually maintained mock servers, which need realistic endpoint behavior and can drift from the API, with Dev Proxy, configured through JSON to intercept the skill's unchanged real URLs and return seeded local data with relevant HTTP semantics. Its data resets between runs, avoiding production writes and API costs. The excerpt presents proxy emulation as a lighter option, while noting the choice depends on the situation; it does not cover the full setup.

### Source excerpt

Your agent skill calls an API. The moment you start evaluating it, every run either costs money or mutates production data. Learn how to mock APIs transparently so you can run evals without changing your skill or hitting real endpoints. The post How to test agent skills without hitting real APIs appeared first on Microsoft for Developers.

## A brief introduction to OpenAPI

DevFeed: [A brief introduction to OpenAPI](<https://devfeed.tech/articles/a-brief-introduction-to-openapi-19081.md>)

Original publisher: [Read original article](<https://httptoolkit.com/blog/introduction-to-openapi/>)

Author: HTTP Toolkit; Phil Sturgeon

Published: 2023-11-28T09:30:00Z

Content type: article

Language: en

Sources: [HTTP Toolkit](<https://devfeed.tech/sources/http-toolkit.md>)

Topics: [OpenAPI Specification](<https://devfeed.tech/topics/openapi.md>), [Documentation](<https://devfeed.tech/topics/documentation.md>), [REST API](<https://devfeed.tech/topics/rest-api.md>), [SDK](<https://devfeed.tech/topics/sdk.md>), [Software Testing](<https://devfeed.tech/topics/software-testing.md>), [mock api](<https://devfeed.tech/topics/mock-api.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [apis](<https://devfeed.tech/tags/apis.md>), [documentation](<https://devfeed.tech/tags/documentation.md>), [format](<https://devfeed.tech/tags/format.md>), [generate](<https://devfeed.tech/tags/generate.md>), [http](<https://devfeed.tech/tags/http.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [json](<https://devfeed.tech/tags/json.md>), [json-schema](<https://devfeed.tech/tags/json-schema.md>), [metadata](<https://devfeed.tech/tags/metadata.md>), [openapi](<https://devfeed.tech/tags/openapi.md>), [reference](<https://devfeed.tech/tags/reference.md>), [request](<https://devfeed.tech/tags/request.md>), [specifications](<https://devfeed.tech/tags/specifications.md>), [standards](<https://devfeed.tech/tags/standards.md>), [swagger](<https://devfeed.tech/tags/swagger.md>), [tools](<https://devfeed.tech/tags/tools.md>), [type](<https://devfeed.tech/tags/type.md>), [type-system](<https://devfeed.tech/tags/type-system.md>), [type-systems](<https://devfeed.tech/tags/type-systems.md>), [validation](<https://devfeed.tech/tags/validation.md>)

### AI overview

OpenAPI is a machine-readable description format for HTTP APIs, specifying metadata, endpoints, request and response formats, authentication, and validation details. Based on JSON Schema, it gives REST-style APIs a type system. Teams commonly use OpenAPI specifications to generate reference documentation; the excerpt also describes validation, contract testing, client- and server-side validation, SDKs, server stubs, and mock servers as uses across the API lifecycle. Redoc can generate documentation sites from a spec, while HTTP Toolkit uses published specs to validate request parameters and show metadata with requests and responses. The supplied text is an excerpt and ends during the HTTP Toolkit example.

### Source excerpt

It's hard to work on APIs without hearing about OpenAPI. OpenAPI is an API description format, which is essentially metadata that describes an HTTP API: where it lives, how it works, what data is available, and how it's authenticated. Additional keywords can be used to provide all sorts of validation information, adding a type system to what would otherwise just be arbitrary JSON flying around the internet. OpenAPI has been around for donkeys years, previously known as Swagger but renamed to OpenAPI in 2016. It's powered by JSON Schema, which is also pretty popular in certain circles, but it's only in the last few years that OpenAPI has solidified its place as the description format for HTTP APIs, pushing aside others like RAML and API Blueprint. Elder developers will remember working with WSDLs and XML Schema, and gRPC and GraphQL folks might be thinking "hang on this sounds a bit familiar", and absolutely. Type systems for APIs are pretty common, but here's an excellent one you can use for your REST/RESTish API. Here's an example to give you an idea: openapi: 3.1.3 info: title: Your Awesome API version: '1.0.3' description: More information and introduction. paths: /things: post: summary: Create a thing requestBody: content: application/json: schema: type: object properties: name: type: string examples: - Tim responses: '201': description: "Created" content: application/json: schema: type: object properties: id: type: string format: uuid name: type: string examples: - Tim created_at: type: string format: date-time example: 2020-01-01T00:00:00Z This describes an API in a machine-readable format, including overall metadata, endpoint paths, request formats, and the details of possible responses you might receive. What can OpenAPI do? OpenAPI specifications provide a machine-readable base on top of which lots of neat API tools can be used and even generated. One of the most common uses by many API teams to to generate API reference documentation, which helps end-users

## Guide to Maestro UI Testing with API Mocking Using WireMock

DevFeed: [Guide to Maestro UI Testing with API Mocking Using WireMock](<https://devfeed.tech/articles/guide-to-maestro-ui-testing-with-api-mocking-using-wiremock-22887.md>)

Original publisher: [Read original article](<https://maestro.dev/blog/guide-to-maestro-ui-testing-with-api-mocking-using-wiremock>)

Author: Ashish Kharche

Published: 2023-06-19T07:00:00Z

Content type: tutorial

Language: en

Sources: [Mobile](<https://devfeed.tech/sources/mobile-dev-medium.md>)

Topics: [mock api](<https://devfeed.tech/topics/mock-api.md>), [Software Testing](<https://devfeed.tech/topics/software-testing.md>), [ui-testing](<https://devfeed.tech/topics/ui-testing.md>), [User Interfaces](<https://devfeed.tech/topics/user-interfaces.md>), [Mocking](<https://devfeed.tech/topics/mocking.md>), [Test automation](<https://devfeed.tech/topics/test-automation.md>)

Tags: [api-mocking](<https://devfeed.tech/tags/api-mocking.md>), [guide](<https://devfeed.tech/tags/guide.md>), [maestro](<https://devfeed.tech/tags/maestro.md>), [mocking](<https://devfeed.tech/tags/mocking.md>), [mocks](<https://devfeed.tech/tags/mocks.md>), [testing](<https://devfeed.tech/tags/testing.md>), [ui](<https://devfeed.tech/tags/ui.md>), [ui-testing](<https://devfeed.tech/tags/ui-testing.md>)

### AI overview

WireMock can provide an HTTP server with stubbed API responses for Maestro UI tests, reducing reliance on inconsistent, unavailable, or team-dependent backends. It supports response stubbing, request verification, proxying and interception, recording and playback, and fault injection. Proxy mode can mock selected endpoints while leaving other app requests connected to the live API. The excerpt introduces local setup and WireMock Cloud's web UI; Cloud provides a secure HTTPS URL, and the guide recommends its web UI as easy and efficient while also covering local use and underlying JSON. The supplied setup section is truncated, so it does not provide the actual installation steps.

### Source excerpt

Mock with WireMock, UI test with Maestro

## Interfaces 101 : Testing with a Mock Interface Ep. 8

DevFeed: [Interfaces 101 : Testing with a Mock Interface Ep. 8](<https://devfeed.tech/articles/interfaces-101-testing-with-a-mock-interface-ep-8-22220.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2023/03/interfaces-101-testing-with-a-mock-interface-ep-8.html>)

Published: 2023-03-20T00:00:00Z

Content type: tutorial

Language: en

Sources: [William Kennedy](<https://devfeed.tech/sources/william-kennedy.md>)

Topics: [interface](<https://devfeed.tech/topics/interface.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>), [mock api](<https://devfeed.tech/topics/mock-api.md>), [client library](<https://devfeed.tech/topics/client-library.md>), [Code Modularity](<https://devfeed.tech/topics/code-modularity.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [client](<https://devfeed.tech/tags/client.md>), [go](<https://devfeed.tech/tags/go.md>), [golang](<https://devfeed.tech/tags/golang.md>), [health-check](<https://devfeed.tech/tags/health-check.md>), [http](<https://devfeed.tech/tags/http.md>), [http-roundtripper](<https://devfeed.tech/tags/http-roundtripper.md>), [interface](<https://devfeed.tech/tags/interface.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [mock](<https://devfeed.tech/tags/mock.md>), [mock-api](<https://devfeed.tech/tags/mock-api.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tests](<https://devfeed.tech/tags/tests.md>), [transport](<https://devfeed.tech/tags/transport.md>), [unit-test](<https://devfeed.tech/tags/unit-test.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>), [unit-tests](<https://devfeed.tech/tags/unit-tests.md>), [video](<https://devfeed.tech/tags/video.md>), [watch](<https://devfeed.tech/tags/watch.md>)

### AI overview

The excerpt describes building a Go API client that makes an HTTP request and returns an error based on the server's response code, then testing it without a real server. A custom type implementing the relevant interface is used as the request transport so tests can specify the response code. The episode also recaps the design guidance that interfaces should describe needed behavior and stay small to support composability.

### Source excerpt

Introduction In episode 7, Miki discussed design considerations to keep in mind while creating interfaces in Go with the first idea he proposed being that an interface should represent what we need from a type, and not what is stored on the type. To add some clarity to this thought, Miki explained how the io.Reader and io.Writer interfaces each require one method to be implemented although the underlying concrete type may store more information. The second idea he proposed was that interfaces should be small, with less than 6 methods, to ensure your code remains composable.

## Testing React Components with Convex

DevFeed: [Testing React Components with Convex](<https://devfeed.tech/articles/testing-react-components-with-convex-81460.md>)

Original publisher: [Read original article](<https://stack.convex.dev/testing-react-components-with-convex>)

Author: Stack

Published: 2023-02-10T18:30:00Z

Content type: tutorial

Language: en

Sources: [Stack](<https://devfeed.tech/sources/stack.md>)

Topics: [React](<https://devfeed.tech/topics/react.md>), [Mocking](<https://devfeed.tech/topics/mocking.md>), [Unit testing](<https://devfeed.tech/topics/unit-testing.md>), [mock api](<https://devfeed.tech/topics/mock-api.md>)

Tags: [convex](<https://devfeed.tech/tags/convex.md>), [fullstack](<https://devfeed.tech/tags/fullstack.md>), [react](<https://devfeed.tech/tags/react.md>), [react-hooks](<https://devfeed.tech/tags/react-hooks.md>), [testing](<https://devfeed.tech/tags/testing.md>), [typescript](<https://devfeed.tech/tags/typescript.md>), [walkthroughs](<https://devfeed.tech/tags/walkthroughs.md>)

### AI overview

This tutorial demonstrates two ways to test React components that call Convex hooks: mock the Convex React hooks or inject a fake Convex client. Its example uses a TypeScript React app with Vitest and a counter component.

### Source excerpt

Oftentimes during testing we want to mock out our backend so we can unit test our UI components without talking to our actual server code. In this article, we'll explore options for testing React components that call Convex React hooks using mocking and dependency injection. To do this, I've written a sample TypeScript React app using the Vitest testing framework. The patterns presented in this post are also applicable to other JavaScript apps and frameworks.

## Mocking API Requests in Node tests

DevFeed: [Mocking API Requests in Node tests](<https://devfeed.tech/articles/mocking-api-requests-in-node-tests-52519.md>)

Original publisher: [Read original article](<http://www.jackfranklin.co.uk/blog/mocking-web-requests/>)

Published: 2013-08-19T00:00:00Z

Content type: tutorial

Language: en

Sources: [Jack Franklin](<https://devfeed.tech/sources/jack-franklin.md>)

Topics: [mock api](<https://devfeed.tech/topics/mock-api.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>), [Test automation](<https://devfeed.tech/topics/test-automation.md>), [API](<https://devfeed.tech/topics/api.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [mocking](<https://devfeed.tech/tags/mocking.md>), [node](<https://devfeed.tech/tags/node.md>), [tests](<https://devfeed.tech/tags/tests.md>)

### AI overview

Nock lets Node tests mock HTTP requests without changing the code that makes them, avoiding the real network calls that made the author's tests slow, unreliable, and unavailable offline. The example intercepts a GET request and returns a chosen status and body; mocks are consumed after one matching request unless `.persist()` is used. Use `isDone()` to check whether a mocked request was called, and `nock.cleanAll()` after each test to remove mocks. The excerpt ends partway through the discussion of assertions.

### Source excerpt

Recently I sat down with my Pulldown Project, aiming to rewrite the tests. The problem with them was that they were network dependent. Each test would hit the real API and download the real file. This was not good for a number of reasons: I couldn't run the tests without an internet connection the tests were slow the tests were unreliable, they would sometimes pass, and other times not Unreliable tests are worse than no tests, so I ripped them out and started again. Meet Nock The solution to this is Nock, a Node module for mocking HTTP requests. With Nock you can mock a HTTP request and make it always return a specific result. Here's an example: var nock = require("nock"); var http = require("http"); var api = nock("http://javascriptplayground.com") .get("/test/") .reply(200, "Hello World"); http.get("http://javascriptplayground.com/test/", function(resp) { var str = ""; resp.on("data", function(data) { str += data; }); resp.on("end", function() { console.log("Got Result: ", str); }); }); In that code we do two things. First, we mock a request to http://javascriptplayground.com/test/ and make it return the string "Hello World" with a 200 status code. Then we use Node's http library to make a request and log it out. We then get "Got Result: Hello World" outputted when we run the above. What's so great about this is that http.get is none-the-wiser about what just happened. You don't have to change any code to make this work, just mock the request. There's no requirement to return a string, either. You can return an object, an array, whatever you'd like. A Gotcha When you mock something using nock, it only works once. Once a URL you've mocked is hit, the mock is then destroyed. To fix this, you can make a specific mocked URL persist: var api = nock("http://javascriptplayground.com") .persist() .get("/test/") .reply(200, "Hello World"); Now it will last forever, until you call cleanUp, which I'll cover shortly. Asserting If you need to test thaat a specific URL is calle