Command: vcr
The turbot vcr command runs a background process to record and mock HTTP requests. It is commonly used with turbot test.
VCR records HTTP requests and responses during test execution. On first run it records real HTTP interactions ("recording mode"). On subsequent runs it replays recorded responses ("playback mode"), providing faster tests with no external dependencies and consistent results.
Usage
Usage: turbot vcr <command>
Supported Sub-commands
| Command | Description |
|---|---|
turbot vcr start | Start the VCR mockserver to record and replay mock responses |
turbot vcr stop | Stop the VCR mockserver |
turbot vcr restart | Restart the VCR mockserver |
turbot vcr replay | Show recent logs from the VCR mockserver (last 1000 lines) |
Requirements
- Docker installed and running
- Port 1080 available
Basic Workflow
# Start VCR before running tests
turbot vcr start
# Run tests (VCR records HTTP traffic)
turbot test
# Stop VCR when done
turbot vcr stop