karma-spec-reporter prints every individual spec's description in a readable, indented hierarchy as it runs — a big step up in visibility from the default progress reporter. This lesson covers installing and tuning it.
Installing karma-spec-reporter
Unlike progress, spec prints every describe()/it() description as it executes, indented to reflect nesting, with a checkmark or cross next to each spec's result. This makes it far easier to see exactly what a suite covers just from reading the output.
npm install --save-dev karma-spec-reporter
// karma.conf.js
config.set({
reporters: ['spec']
});
// Example output:
// Calculator
// ✓ adds two numbers
// ✗ throws on invalid input
// Expected function to throw an error.
The indentation mirrors nested describe() blocks, making the test suite's structure visible directly in the terminal.
suppressPassed: true shows only failures, useful for very large, mostly-passing suites.
showSpecTiming: true prints per-spec duration, helpful for spotting unexpectedly slow tests.
suppressSkipped: true (a common default) hides xit/xdescribe skipped specs from cluttering output.
maxLogLines caps how many lines of a failure's stack trace print before truncating.
specReporter Options Cheat Sheet
The most useful display tuning options.
Option
Effect
suppressPassed
Hide passing specs, showing only failures
suppressSkipped
Hide skipped/pending specs from output
showSpecTiming
Print how long each individual spec took
maxLogLines
Limit stack trace length per failure
failFast
Stop the run as soon as one spec fails
spec vs. progress: Choosing Between Them
spec trades output volume for visibility — it's the better choice while actively writing tests locally, since seeing every spec description helps confirm you've covered what you intended. For CI logs on a very large suite, the extra volume can sometimes be more noise than signal, in which case progress (or spec with suppressPassed: true) may be preferable.
Scenario
Better Choice
Actively writing new tests locally
spec
Very large suite, CI log readability matters
progress or spec with suppressPassed
Want to confirm test coverage by reading output
spec
Minimal, fast-to-scan CI summary
progress
Combining spec with a File-Writing Reporter
spec is purely a terminal reporter — it prints nothing to a file. Pairing it with junit or html gives you both a readable live run and a durable, machine-consumable artifact.
Using spec on an enormous suite in CI without suppressPassed, flooding logs unnecessarily.
Forgetting spec writes nothing to disk, and needing a separate reporter for CI artifacts anyway.
Not enabling showSpecTiming when hunting for a specific slow test dragging down suite run time.
Assuming failFast is Karma's default behavior — it must be explicitly enabled on specReporter.
Key Takeaways
karma-spec-reporter prints every spec description in a readable, indented hierarchy.
It's ideal for local development, where seeing exactly what ran (and its result) is valuable.
specReporter options let you suppress passed/skipped specs and show per-spec timing.
Pair spec with a file-writing reporter like junit for a complete local + CI reporting setup.
Pro Tip
Enable showSpecTiming: true for a week after inheriting an unfamiliar, slow test suite. It's usually enough time to spot the handful of specs responsible for most of the total run time, which are almost always worth investigating individually.
You now understand the spec reporter in depth. Next, learn about the JUnit reporter for CI system integration.