fast-api-tester 1.0.9 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/readme +29 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fast-api-tester",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "Ultra-fast, connection-pooled API testing library for Node.js",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/readme CHANGED
@@ -161,6 +161,34 @@ All HTTP methods return a uniform response structure:
161
161
 
162
162
  ---
163
163
 
164
+ ## 📡 Advanced Features
165
+
166
+ ### Standalone Monitoring Setup (`startHeartbeat`)
167
+
168
+ For continuous monitoring — as opposed to a single-run test suite — use `startHeartbeat` to run checks on a recurring interval. This is kept separate from your Vitest/Jest suites so that test runners don't auto-terminate the infinite monitoring loop.
169
+
170
+ ```typescript
171
+ import { ApiEngine } from './index';
172
+
173
+ const api = new ApiEngine().setBaseUrl('https://api.example.com');
174
+
175
+ // Continuous heartbeat monitoring loop
176
+ api.startHeartbeat(async () => {
177
+ const res = await api.get('/health');
178
+ res.expectLatencyUnder(200);
179
+ });
180
+ ```
181
+
182
+ ### 📊 Interactive HTML Analytics & Historical Tracking
183
+
184
+ Every execution run updates `test-report.html` and persists historical execution data to `.test-history.json` (retaining the last 10 runs).
185
+
186
+ - **Current Run Breakdown**: Visual status pie chart for fast status verification.
187
+ - **Historical Execution Trend**: Stacked bar chart visualizing test pass/fail trends over time across consecutive heartbeats.
188
+ - **Detailed Table View**: Complete summary including HTTP Method, Endpoint, Status Code, Measured Latency, SLA Target, and exact error stack/messages for failing requests.
189
+
190
+ ---
191
+
164
192
  ## 📜 License
165
193
 
166
- [MIT](./LICENSE) © Kushan Amarasiri
194
+ [MIT](./LICENSE) © Kushan Amarasiri