teams-ctrf is a utility designed to send structured test result notifications to Microsoft Teams channels, adhering to the Common Test Report Format (CTRF) specification. This package allows teams to automate the reporting of test execution outcomes, including summaries, detailed reports, and flaky test detection, directly into their Teams environment. It is currently in active development, with version `0.0.6` being the stable release, and `0.0.7-next` actively introducing new features and refinements. The project is part of the broader CTRF ecosystem, which aims to standardize test reporting across various testing frameworks and programming languages, providing a unified JSON format for consistent analysis and comparison. It stands out by integrating directly with the CTRF standard, offering both command-line and programmatic interfaces for flexible deployment in CI/CD pipelines.
npm install teams-ctrfVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to programmatically send a CTRF report as an Adaptive Card to Microsoft Teams using a webhook URL.
Review the updated API for programmatic message sending. If custom message formats were used, they might need to be refactored to align with the new Adaptive Card structure or utilize the dedicated `sendAdaptiveCard` function for richer formatting. The CLI might also have new options like `--useAdaptiveCard`.
Ensure the `TEAMS_WEBHOOK_URL` environment variable (or directly provided URL) is correctly configured in your Microsoft Teams channel settings. Verify it's an 'Incoming Webhook' connector and has not been revoked. Test the webhook using a simple `curl` command if issues persist.
Double-check the `TEAMS_WEBHOOK_URL` for typos. Ensure your CI/CD environment or local machine has outbound internet access to the Teams webhook endpoint. Regenerate the webhook URL in Teams if necessary.
Validate your CTRF report JSON against the CTRF schema. If customizing the Adaptive Card, ensure its JSON structure is valid according to the Adaptive Cards schema (schema.adaptivecards.io). Minor differences in required fields or data types can cause this error.
Set the `TEAMS_WEBHOOK_URL` environment variable in your shell or CI/CD pipeline configuration. For example: `export TEAMS_WEBHOOK_URL='https://hooks.teams.com/services/your/webhook/url'` (replace with your actual URL).