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

AVA framework

AVA doesn't emit JUnit XML or coverage directly, so the integration uses nyc for coverage (--reporter=json) and pipes AVA's TAP output through tap-xunit to produce JUnit XML. You then drive the standard test-stage lifecycle.

Prerequisites

  • nyc and tap-xunit installed (npm install --save-dev nyc tap-xunit).

  • The build has been scanned.

Lifecycle commands

npx slnodejs start \
  --tokenFile ./sltoken.txt --buildSessionIdFile buildSessionId \
  --testStage "Unit Tests"

# Run AVA with nyc coverage, converting TAP output to JUnit XML
ENV=test npx nyc --reporter=json ./node_modules/.bin/ava --tap | npx tap-xunit > junit.xml

npx slnodejs nycReport \
  --tokenFile ./sltoken.txt --buildSessionIdFile buildSessionId \
  --report ./coverage/coverage-final.json

npx slnodejs uploadReports \
  --tokenFile ./sltoken.txt --buildSessionIdFile buildSessionId \
  --file junit.xml

npx slnodejs end \
  --tokenFile ./sltoken.txt --buildSessionIdFile buildSessionId

Parameters

Parameter
Purpose

--tokenFile / --token

SeaLights authentication

--buildSessionIdFile / --buildSessionId

Build session identifier

--testStage

Stage name (e.g. "Unit Tests")

--report

Path to the nyc coverage file, coverage-final.json (nycReport)

--file

Path to the generated JUnit XML (uploadReports)

--projectRoot for nycReport: if SeaLights fails to match coverage to source files (common in CI/Docker environments where workspace paths differ from build paths), add --projectRoot <path> to the nycReport call. See Unit Tests → Parameters for details


Back to → Capturing Tests

Last updated

Was this helpful?