Перейти до вмісту

Цю сторінку ще не перекладено, тому її показано англійською.

Coverage in Tern

Measure test coverage in Tern: the Coverage tab of the Tests page, uncovered-line navigation, tints in the source editor, and coverage for Tern's agent.

Експериментально

Експериментально
Ця функція експериментальна: її команди, параметри та вивід можуть змінюватися між версіями. Повідомити про проблему

Читати офлайнelide help --lang uk tern-coverage

На цій сторінці
Використовувати з ШІ
Відкрити в ChatGPTВідкрити в Claude

Press c on the Tests page and the run comes back with a Coverage tab: totals, the measured files and, for the file you select, every line tinted by whether the tests ran it. In the source editor the same measurement tints the rows under your caret while you keep editing.

TernCoverage in the source editor0:09In the Elide source editor, F5 runs the tests with coverage and tints covered, uncovered and partly covered lines.

Run with coverage

FromHow
A Tern terminalelide test --coverage
The Tests pageRun with coverage (c)
The source editorRun with coverage (F5) in the Coverage overlay
Tern’s agenttest_cover(binding, subject, command); see Shared sessions

Run again keeps the run’s coverage option. Each run keeps its own measurement, so earlier runs in the history are unchanged.

Coverage tab

The tab appears once the run is measured. It shows the line and branch totals, files measured and uncovered lines, then the measured files with their covered, partly covered and uncovered lines. Selecting a file shows its current source with each measured line tinted; a file over 600 lines shows without highlighting.

KeyAction
j k, ↑ ↓Select a file.
n, pNext uncovered and Previous uncovered line.
Click Open line N in Elide sourceOpen the file at that line in the source editor.

Lines the runtime does not measure, such as closing braces, blank lines and comments, take a lighter tint when the block they belong to ran. They are not counted in the percentages. Branch counts show where the runtime reports them; a file without branch data says so instead of showing zero.

Buttons that open files, such as Open in Elide source and Open on a test’s card, respond to a click, not Enter. ⌘-click a linked file name to open it.

Source editor

The Coverage overlay of the source editor tints rows from the project’s newest coverage run while you keep editing:

TintLine
SuccessCovered.
Lighter successNot measured, inside a block that ran.
WarningPartly covered; the branch count shows beside the line.
ErrorUncovered.
MutedEdited since the measurement.

The toolbar badge and status bar show the file’s percentage. When the file on disk no longer matches the measured source, every tint turns muted and the editor says Coverage measured an older version. F6 refreshes from the newest run.

Measured source

A measurement describes the source the runtime evaluated, even when the file changed before the report was written. A missing source fingerprint or branch measurement means the data is unavailable; it does not mean the file is current or that no branch ran. Line coverage records whether a line ran, not how many times. A report holds up to 2,000 files and 200,000 lines.

Report formats and the coverage artifact: Coverage.

Next

Tests measured, the next thing to fix is the build. Build diagnostics puts each javac and kotlinc error on its line.

Чи була ця сторінка корисною?