UNPKG

network-performance-monitor

Version:

A comprehensive network performance monitoring tool that continuously tests and tracks your network's performance over time

52 lines (40 loc) 1.44 kB
# Test Mode Documentation ## Overview Test mode allows you to run scheduled speed tests at configurable intervals instead of waiting for the top of each hour. This is particularly useful for regression testing and debugging. ## Usage ### Starting in Test Mode ```bash npm start -- --test-mode --speed-test-interval 10000 ``` Or with custom port: ```bash npm start -- --test-mode --speed-test-interval 10000 --port 3001 ``` ### Parameters - `--test-mode`: Enables test mode - `--speed-test-interval <ms>`: Sets the interval for scheduled speed tests in milliseconds (default: 10000) - `--port <port>`: Web UI port (default: 3000) ## Running Regression Tests ### All Tests ```bash npm run test:all ``` ### Scheduled Speed Test Only ```bash npm run test:scheduled ``` This test will: 1. Start daemon in test mode with 10-second intervals 2. Verify scheduled speed tests run immediately 3. Verify multiple scheduled tests run at the configured interval 4. Verify stderr output doesn't interfere with JSON parsing ## Test Database During tests, a temporary database `test-performance.db` is created and cleaned up automatically. ## Environment Variables - `DB_PATH`: Override the database path for testing ## Example Test Output ``` ✓ should run scheduled speed test immediately in test mode (30s) ✓ should run multiple scheduled speed tests at configured interval (15s) ✓ should handle speedtest-cli stderr output correctly ```