How growtherapy/jest-performance-reporter works
This package is a Jest reporter that identifies slow tests and prints timings, with optional JSON and CSV reports. The workflow starts when Jest completes a run: the reporter extracts completed test results, prints the slowest results according to configured thresholds, and optionally writes files (except in watch mode). The README also documents reporter configuration and both file formats. Source excerpts show the main calls and helper relationships; the filesystem and CSV-writer integrations are inferred from the shown writes and imports.
Main entry points: index.ts Run reporter · json.ts JSON report · csv.ts CSV report · ensure-directory.ts Directory helper
Components 10
Reporter workflow
- Run reporter
packages/core/src/index.ts - Result extraction
packages/core/src/core/jest-mapping.ts
Report outputs
- Terminal report
packages/core/src/reports/terminal/index.ts - Threshold and logging
packages/core/src/reports/terminal/log.ts - JSON report
packages/core/src/reports/json.ts - CSV report
packages/core/src/reports/csv.ts
Shared helpers
- Directory helper
packages/core/src/core/ensure-directory.ts
Other components
- Jest runner
- Filesystem
- CSV writer library
Connections 11
- Jest runner → Run reporter: configures reporter
README.md - Run reporter → Result extraction: extracts results
packages/core/src/index.ts - Run reporter → Terminal report: prints results
packages/core/src/index.ts - Run reporter → JSON report: writes JSON
packages/core/src/index.ts - Run reporter → CSV report: writes CSV
packages/core/src/index.ts - Terminal report → Threshold and logging: classifies and logs
packages/core/src/reports/terminal/index.ts - JSON report → Directory helper: ensures directory
packages/core/src/reports/json.ts - CSV report → Directory helper: ensures directory
packages/core/src/reports/csv.ts - Directory helper → Filesystem: checks and creates
packages/core/src/core/ensure-directory.ts - JSON report → Filesystem: writes file
packages/core/src/reports/json.ts - CSV report → CSV writer library: writes records
packages/core/src/reports/csv.ts