- Introduction
- Getting started
- Philosophy
- Comparison
- Limitations
- Debugging runbook
- FAQ
- Basics
- Concepts
- Network behavior
- Integrations
- API
- CLI
- Best practices
- Recipes
- Cookies
- Query parameters
- Response patching
- Polling
- Streaming
- Network errors
- File uploads
- Responding with binary
- Custom worker script location
- Global response delay
- GraphQL query batching
- Higher-order resolver
- Keeping mocks in sync
- Merging Service Workers
- Mock GraphQL schema
- Using CDN
- Using custom "homepage" property
- Using local HTTPS
close()
Stops the request interception in the current Node.js process.
Call signature
The server.close()
function does not accept any argument and doesn’t return anything. It is a synchronous function since request interception in Node.js is performed via native class extensions, which is a synchronous process.
server.close()
This method is designed to be called when the API mocking capabilities are no longer needed, for example when the test run is finished.