For the complete documentation index, see llms.txt. This page is also available as Markdown.

Capturing Tests

Once your code reports coverage (via Frontend or Backend instrumentation), SeaLights needs to know which tests ran and what they covered. Capturing tests records each test's execution and ties it to the code it exercised — enabling test impact analysis, broken-test detection, and risk-based test selection.

There are two ways tests are captured, depending on the kind of test.

Unit Tests (coverage via NYC / Istanbul)

Unit tests run the code directly in the test process — there is no separate application under test. SeaLights collects JavaScript coverage produced by NYC / Istanbul (line, branch, and function level) during the test run, then uploads it.

  • No instrumented deployment or running server is required.

  • You upload the NYC coverage report with nycReport, and the test results (JUnit XML) with uploadReports.

  • For unit tests, SeaLights recommends identifying the stage by Build Session ID rather than a Lab ID.

➡️ How-to with commands: Unit Tests, and the framework guides — Mocha, Karma, AVA.

Functional Tests

Functional tests run against a live, instrumented application (see Frontend or Backend Instrumentation). As tests drive the app, the instrumented code reports footprints, and SeaLights correlates each request with the test that triggered it — giving per-test functional coverage.

  • Requires a running instrumented app and a Lab ID that connects the test listener to the coverage listener.

  • Test results are uploaded with uploadReports; functional coverage comes from the running agent, not nycReport.

➡️ Set up the application first: Frontend Instrumentation · Backend Instrumentation.

Choosing the right approach

Unit Tests
Functional Tests

Application under test

None — runs in the test process

Live, instrumented app

Coverage source

NYC / Istanbul report (nycReport)

Footprints from the running agent

Identifier

Build Session ID

Lab ID

Typical stage

"Unit Tests"

"Functional Tests", "E2E", …

The test stage lifecycle

Whichever approach you use, the listener follows the same shape (the framework pages show the exact commands):

Uploading multiple report files

When your test suite produces several JUnit XML files (e.g. parallel test runs, per-package reports), there are two approaches to upload them all.

Folder-based upload — point --reportFilesFolder at the directory. SeaLights processes every file in the folder.

Loop-based upload — iterate over files matching a pattern for fine-grained control.


Framework guides: Unit Tests · Mocha · Karma · AVA

Last updated

Was this helpful?