also looking at this
Define stable JSON event protocol
#27
11 files
+442
-177
| @@ -820,28 +820,33 @@ Passed: 12, Failed: 0, Total: 12 (1.23ms) | ||
| 820 | 820 | |
| 821 | 821 | ### JSON Reporter |
| 822 | 822 | |
| 823 | Machine-readable output for tooling: | |
| 823 | Machine-readable output uses the versioned event protocol shared with the live | |
| 824 | UI and test history: | |
| 824 | 825 | |
| 825 | 826 | ```json |
| 826 | { | |
| 827 | "totalTests": 12, | |
| 828 | "tests": [ | |
| 829 | { | |
| 827 | [ | |
| 828 | { | |
| 829 | "protocol_version": 1, | |
| 830 | "type": "run_start", | |
| 831 | "data": { "total": 12 } | |
| 832 | }, | |
| 833 | { | |
| 834 | "protocol_version": 1, | |
| 835 | "type": "test_end", | |
| 836 | "data": { | |
| 830 | 837 | "name": "should add two numbers", |
| 838 | "suite": "Math operations", | |
| 831 | 839 | "status": "passed", |
| 832 | "time": 0.05 | |
| 840 | "duration_ns": 50000, | |
| 841 | "error_message": null | |
| 833 | 842 | } |
| 834 | ], | |
| 835 | "summary": { | |
| 836 | "total": 12, | |
| 837 | "passed": 12, | |
| 838 | "failed": 0, | |
| 839 | "skipped": 0, | |
| 840 | "time": 1.23 | |
| 841 | 843 | } |
| 842 | } | |
| 844 | ] | |
| 843 | 845 | ``` |
| 844 | 846 | |
| 847 | See [docs/json-event-protocol.md](docs/json-event-protocol.md) for every event | |
| 848 | type and the compatibility policy. | |
| 849 | ||
| 845 | 850 | ## API Reference |
| 846 | 851 | |
| 847 | 852 | See [docs/api.md](docs/api.md) for complete API documentation. |