The `typescript-xunit-xml` package provides a command-line interface and a programmatic API for converting the diagnostic output of the TypeScript compiler (`tsc`) into an xUnit-style XML format. This conversion is highly beneficial for integrating TypeScript build processes with continuous integration (CI) systems like Jenkins, GitLab CI, or Azure DevOps, allowing them to interpret compilation errors and warnings as test failures. The package is currently at version 1.2.0, with its last publish occurring approximately three years ago, suggesting a maintenance rather than active development cadence. Its primary differentiator lies in its focused design specifically for `tsc` output, offering a streamlined solution for reporting TypeScript-specific issues without requiring broader testing frameworks. While it functions effectively as a CLI tool via pipe operations, it also exposes `parse` and `format` functions for direct programmatic use within Node.js applications, enabling more custom integration scenarios.
npm install typescript-xunit-xmlVerified import paths — ran on the pinned version, not inferred.
Demonstrates programmatic usage of `typescript-xunit-xml` to process TypeScript compiler output from a dummy project and generate an xUnit XML report, simulating typical CI/CD integration.
Monitor for updates to `typescript-xunit-xml` when upgrading major TypeScript compiler versions. If issues arise, consider contributing a fix or using an alternative reporter.
Ensure `tsc` is invoked without the `--pretty` flag when its output is piped to `typescript-xunit-xml`. The roadmap indicates future support, but it's not present in v1.2.0.
Ensure `tsc` output is pristine. Use direct piping (`|`) and avoid intermediate tools that might reformat text. In Node.js, capture `stderr` and `stdout` directly from `child_process` as demonstrated in the quickstart.
Understand how your CI system interprets xUnit 'skipped' vs. 'failed' test cases. Adjust build failure criteria in your CI pipeline if you wish warnings to cause a hard build break.
Install the package globally (`npm install -g typescript-xunit-xml`), or use `npx typescript-xunit-xml`, or ensure `node_modules/.bin` is in your PATH in shell scripts.
Install TypeScript globally (`npm install -g typescript`) or ensure `tsc` is available in your project's `node_modules/.bin` (e.g., by adding `"scripts": { "test": "tsc && ..." }` to `package.json` and running `npm test`).Ensure `tsc` is run without the `--pretty` flag and that no other tools are altering its `stdout` or `stderr` before it reaches `typescript-xunit-xml`.
No dependency data recorded yet.