Skip to content
axxbetadocs
nextv0.2.26
GitHub
These are the docs of main, not released yet. See the docs of v0.2.26, the latest release.

Coverage

View .mdOpen in Claude

Find out how much of the web apps’ JavaScript the scenarios run. The pack collects the coverage of the scripts the pages load, in Chromium, Chrome and Edge, as the scenarios run, and writes it when the run ends: lcov.info, for editors and coverage services, and Istanbul’s coverage-final.json and coverage-summary.json, in .axx/web/coverage (folder). It has no steps: add it to the project, and every scenario’s pages count. It builds on the web-core pack.

  • What counts. The scripts the pages load from their web app’s origin, named by their URL path, like js/track.js; for a script with a source map, its original files instead, TypeScript and all. Scripts of other origins, inline scripts and event handlers do not count. With sources, only the scripts under those URL paths count, named as the files of the project they are.
  • How it counts. Chromium’s own coverage (V8’s): the lines, functions and branches that ran, and how many times, over every page of every scenario, taken after each step and before a page leaves its document. The reports are those Node’s tools (c8) write from the same coverage. A tab a page opens counts from when it opens. In Firefox and WebKit, the pages run without coverage.
packs:
web-coverage:
sources:
/portal/js/: ../app/web/js # the scripts under /portal/js/, in the project
/portal/src/: ../app/web/src # the original files of their source maps

A source map without its original files’ content finds them through sources too.

Add it to a project with axx pack add web-coverage; it builds on web-core, which comes with it.

In axx.yaml, under packs.web-coverage:

Setting Takes Values Default
folder The folder the reports go to, in the project: lcov.info, coverage-final.json and coverage-summary.json. text .axx/web/coverage
sources Where the scripts are in the project, by the start of their URL path: {“/portal/js/”: “../app/web/js”}, a folder relative to the project. Only the scripts (or, through their source maps, the original files) whose URL path starts with one count, named by its folder and the rest of the path. Without it, every script the pages load from their web app’s origin counts, named by its URL path without the leading slash. names and values