Testing
This guide covers testing KayakNet during development and for quality assurance.
Test Types
Unit Tests
Test individual functions and components:
# Run all unit tests
go test ./...
# With verbose output
go test -v ./...
# Specific package
go test ./internal/chat/...
# With coverage
go test -cover ./...Integration Tests
Test component interactions:
End-to-End Tests
Test complete user flows (manual):
Start bootstrap node
Start test nodes
Perform actions
Verify results
Running Tests
Quick Test
Full Test Suite
Specific Tests
Test Coverage
Generate Report
Coverage Goals
crypto
90%+
e2e
85%+
chat
80%+
market
80%+
escrow
85%+
Writing Tests
Test Structure
Table-Driven Tests
Mocking
Manual Testing
Local Network Setup
Test Scenarios
Chat Test
Node A joins room
#testNode B joins room
#testNode A sends message
Verify Node B receives message
Marketplace Test
Node A creates listing
Node B searches for listing
Verify listing appears
Node B creates order
Verify escrow created
Domain Test
Node A registers
test.kykNode B looks up
test.kykVerify resolution
Browser Testing
Setup
Start node with
--proxyConfigure browser proxy to
127.0.0.1:8118Navigate to
http://home.kyk
Test Cases
Homepage
Loads correctly
Chat
Send/receive messages
Marketplace
Browse listings
Domains
Search works
Escrow
Create order
Performance Testing
Load Test
Benchmark Tests
Run benchmarks:
CI/CD Integration
GitHub Actions
Debugging Tests
Verbose Output
With Logging
Debugging Failures
Last updated

