A clean, color-coded test output filter for dart test and flutter test. Suppresses noisy JSON reporter logs and replaces them with a live progress line and clear failure details.
- Works with both
dart testandflutter test - Live progress bar with completed/total count and percentage
- Color-coded output: green for passed, yellow for skipped, red for failed
- Inline failure details with error messages and stack traces
- Clean summary banner at the end
- ANSI color support detection (including Windows)
- Exits with code
1when any test fails
- Python 3.10+
- Dart SDK or Flutter SDK
pipx install git+https://github.com/Corkscrews/dart_test_filter.gitThis installs dart-test-filter globally in an isolated environment. No venv activation needed.
make installThis creates a .venv, installs the package and dev dependencies into it.
Activate the venv once, then use dart-test-filter anywhere:
source .venv/bin/activate
cd your_dart_project/
dart test --reporter json | dart-test-filter
flutter test --reporter json | dart-test-filterOr skip activation and use the full path:
dart test --reporter json | /path/to/dart_test_filter/.venv/bin/dart-test-filterPass --ci for CI-friendly output. Suppresses the live progress bar (which uses \r and doesn't render well in CI log viewers) and collapses verbose dependency-resolution output into a single line. Only failures and the final summary are printed.
flutter test --reporter json 2>&1 | dart-test-filter --ciCI output:
Resolving dependencies...
Downloading packages...
Got dependencies! (52 outdated dependencies hidden)
FAIL: subtract subtracts two numbers
Expected: <6>
Actual: <14.0>
test/calculator_test.dart 27:7 main.<fn>.<fn>
==================================================
50 tests: 48 passed, 1 skipped, 1 failed
==================================================
Pass --report to write all errors and skipped tests to a timestamped log file:
dart test --reporter json | dart-test-filter --report
# creates 20260312_143022.logRunning: 42/50 (84%) | Passed: 40 | Skipped: 1 | Failed: 1
FAIL: subtract subtracts two numbers
Expected: <6>
Actual: <14.0>
test/calculator_test.dart 27:7 main.<fn>.<fn>
==================================================
50 tests: 48 passed, 1 skipped, 1 failed
==================================================
make install # create .venv and install package + dev deps
make test # run all tests
make test-unit # unit tests only (no Dart SDK needed)
make test-integration # end-to-end with dart test
make lint # ruff check
make format # ruff format
make clean # remove .venv, caches, build artifactsThe filter reads JSON events from stdin and processes five event types:
| Event | Action |
|---|---|
group |
Extracts total expected test count |
testStart |
Registers the test by ID |
error |
Buffers error/stack trace for the test |
testDone |
Updates counters, prints failures inline |
done |
Prints the final summary banner |
src/dart_test_filter/
├── __init__.py # Package exports and CLI entry point
├── __main__.py # python -m support
└── filter.py # TestFilter class and AnsiColors
tests/
├── conftest.py # Shared fixtures
├── test_filter.py # Unit tests (no Dart SDK needed)
└── test_integration.py # End-to-end with dart test
example/ # Minimal Dart project for integration tests