Common JavaScript library for working with CTRF reports, including type definitions and utility functions.
You can support the project with a follow and a star
Contributions are very welcome!
Explore more integrations
Weβd love your feedback, share it anonymously.
npm install ctrf
- Attachment
- Baseline
- Environment
- InsightsMetric
- Report
- Results
- RetryAttempt
- RootInsights
- Step
- Summary
- Test
- TestInsights
- Tool
- TestStatus
- findSuiteByName
- findTestByName
- flattenTree
- getAllTests
- getSuiteStats
- organizeTestsBySuite
- traverseTree
- SortOrder (enumeration)
- TestTree
- TreeNode
- TreeOptions
- ValidationResult
- TreeTest
- CTRF_NAMESPACE
The library exports comprehensive TypeScript types for working with CTRF reports:
import type { Report, Test, Insights } from "ctrf"; function analyzeReport(report: Report): void { const flakyTests = report.results.tests.filter((test: Test) => test.flaky); const insights = report.insights as Insights; console.log(`Flaky rate: ${insights?.flakyRate.current}`); }
CTRF is a universal JSON test report schema that addresses the lack of a standardized format for JSON test reports.
Consistency Across Tools: Different testing tools and frameworks often produce reports in varied formats. CTRF ensures a uniform structure, making it easier to understand and compare reports, regardless of the testing tool used.
Language and Framework Agnostic: It provides a universal reporting schema that works seamlessly with any programming language and testing framework.
Facilitates Better Analysis: With a standardized format, programatically analyzing test outcomes across multiple platforms becomes more straightforward.
If you find this project useful, consider giving it a GitHub star β It means a lot to us.