> For the complete documentation index, see [llms.txt](https://as-pect.gitbook.io/as-pect/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://as-pect.gitbook.io/as-pect/packages/junit-reporter.md).

# @as-pect/junit-reporter

JUnit XML file reporter for `as-pect` Test sessions.

## Use from the CLI

```sh
npx asp --junit
```

The reporter writes one `.xml` file per test entry, next to that entry, and skips empty Suite reports.

## Programmatic use

```ts
import JUnitReporter from "@as-pect/junit-reporter";

const reporter = new JUnitReporter();
```

Pass an output root to the constructor when relative `SuiteReport.fileName` values should resolve somewhere other than `process.cwd()`.

## Documentation

Detailed JUnit mapping and file-output behavior live in GitBook:

* [Built-in reporters](/as-pect/docs/extending/built-in-reporters.md#junit-xml-reporter)
* [Output files](/as-pect/docs/extending/output-files.md)
* [Reporter package types](/as-pect/docs/types/reporters.md)

Hosted docs: [as-pect.gitbook.io/as-pect](https://as-pect.gitbook.io/as-pect/).
