Reporters are the bridge between your test run and the outside world. Every time the test runner starts a suite, executes a test, or finishes a run, it emits lifecycle events to the active reporter. KT Testing Suite ships two built-in reporters:Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Octopodo/kt-testing-suite-core/llms.txt
Use this file to discover all available pages before exploring further.
ConsoleReporter for human-readable output written directly to the ExtendScript console, and JSONReporter for structured, machine-parseable results — optionally written to a file. Both are driven by the same TestReporter interface, so they can be swapped or composed without changing your test code.
The TestReporter Interface
Every reporter — built-in or custom — implementsTestReporter, defined in reporters/types.ts. The interface exposes six lifecycle hooks that the TestRunner calls in order during a run:
| Method | When it fires |
|---|---|
onStart() | Once, before any suite or test runs |
onSuiteStart(suite) | Each time a describe block is entered |
onTestStart(test) | Immediately before each it callback executes |
onTestEnd(test, result) | After each it callback finishes (pass, fail, or skip) |
onSuiteEnd(suite) | After all tests and nested suites inside a describe complete |
onFinished(results) | Once, after every suite has run, carrying aggregate pass/fail counts |
TestResult and SuiteResult types that flow through these hooks are also exported from reporters/types.ts:
TestResult.error is only populated when status is 'failed'. The fileName and line fields come from the raw ExtendScript error object and may be undefined in some host environments.ConsoleReporter
ConsoleReporter is the default reporter. When you call runTests() without specifying a reporter, TestRunner instantiates one automatically. It writes every event to the ExtendScript host console via $.writeln, producing an indented, emoji-annotated log that is easy to scan in the ESTK console or any IDE that surfaces ExtendScript output.
Output format
The console output follows a fixed three-level structure: suite header, test name, then result line. A final summary block is appended after all suites finish.JSONReporter
JSONReporter serves two roles simultaneously: it mirrors all ConsoleReporter output by delegating every event to an internal ConsoleReporter instance, and it additionally accumulates a structured tree of results that it serialises to JSON when onFinished fires. This means you always get the human-readable console log and the machine-readable payload in one pass.
Output modes
JSONReporter supports two output modes depending on whether a file path was provided to the constructor.
- Console markers (no path)
- File output (with path)
When constructed without an argument, the JSON payload is written to
$.writeln wrapped in sentinel strings that a VS Code extension or script can reliably detect and parse:JSON output structure
The JSON document always contains two top-level keys:stats— aggregate counts:passed,failed,total.suites— an array ofSuiteResultobjects, each of which may recursively contain nestedsuites(for nesteddescribeblocks) and atestsarray ofTestResultobjects.
Using a Reporter
Pass a reporter instance as the second argument torunTests(), or supply it to the TestRunner constructor directly. If no reporter is provided, TestRunner defaults to a new ConsoleReporter.
runTests() accepts suites as its first argument. Pass undefined to run all suites that have been registered globally via describe().