Skip to content

ctrf-io/ctrf-core-js

Repository files navigation

CTRF Common JavaScript Library

Common JavaScript library for working with CTRF reports, including type definitions and utility functions.

💚

CTRF tooling is open source and free to use

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.

Installation

npm install ctrf

API Reference

Schema Types

File Operations Methods

Report Processing Methods

Validation Methods

Tree Operations Methods

Test Operations Methods

Utility Types

TypeScript Types

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}`);
}

What is CTRF?

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.

Support Us

If you find this project useful, consider giving it a GitHub star ⭐ It means a lot to us.

About

CTRF common utilities for Javascript and Typescript

Resources

License

Contributing

Stars

Watchers

Forks