Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added CHANGELOG.md
Empty file.
28 changes: 6 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CTRF CLI

Various CTRF utilities available programatically and by command line
Various CTRF utilities available from the command line

<div align="center">
<div style="padding: 1.5rem; border-radius: 8px; margin: 1rem 0; border: 1px solid #30363d;">
Expand Down Expand Up @@ -39,7 +39,7 @@ This might be useful if you need a single report, but your chosen reporter gener
To merge CTRF reports in a specified directory, use the following command:

```sh
npx ctrf merge <directory>
npx ctrf-cli merge <directory>
```

Replace `directory` with the path to the directory containing the CTRF reports you want to merge.
Expand All @@ -49,19 +49,19 @@ Replace `directory` with the path to the directory containing the CTRF reports y
-o, --output `filename`: Output file name for the merged report. Default is ctrf-report.json.

```sh
npx ctrf merge <directory> --output my-merged-report.json
npx ctrf-cli merge <directory> --output my-merged-report.json
```

-d, --output-dir `directory`: Output directory for the merged report. Default is the same directory as the input reports.

```sh
npx ctrf merge <directory> --output-dir /path/to/output
npx ctrf-cli merge <directory> --output-dir /path/to/output
```

-k, --keep-reports: Keep existing reports after merging. By default, the original reports will be deleted after merging.

```sh
npx ctrf merge <directory> --keep-reports
npx ctrf-cli merge <directory> --keep-reports
```

## Flaky
Expand All @@ -72,7 +72,7 @@ Usage
To output flaky tests, use the following command:

```sh
npx ctrf flaky <file-path>
npx ctrf-cli flaky <file-path>
```

Replace <file-path> with the path to the CTRF report file you want to analyze.
Expand All @@ -87,22 +87,6 @@ Found 1 flaky test(s) in reports/sample-report.json:
- Test Name: Test 1, Retries: 2
```

## Programmatic Methods

```sh
npm install ctrf
```

The following programmatic methods are available:

`mergeReports` - This method merges multiple CTRF reports into a single report.

`readSingleReport` - Reads and parses a single CTRF report file from a specified file path.

`readReportsFromDirectory` - Reads all CTRF report files from a given directory.

`readReportsFromGlobPattern` - Reads all CTRF report files from a given glob pattern.

## What is CTRF?

CTRF is a universal JSON test report schema that addresses the lack of a standardized format for JSON test reports.
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 4 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ctrf",
"version": "0.0.12",
"description": "",
"name": "ctrf-cli",
"version": "0.0.1",
"description": "Various CTRF utilities available from the command line",
"main": "dist/index.js",
"bin": {
"ctrf": "dist/cli.js"
Expand All @@ -13,10 +13,7 @@
"dist/",
"README.md"
],
"repository": {
"type": "git",
"url": "https://github.com/ctrf-io/ctrf-cli"
},
"repository": "github:ctrf-io/ctrf-cli",
"homepage": "https://ctrf.io",
"author": "Matthew Thomas",
"license": "MIT",
Expand Down
1 change: 1 addition & 0 deletions src/methods/merge-reports.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// TO BE REMOVED, WILL USE THE CTRF LIBRARY INSTEAD
import { CtrfReport, Summary } from "../../types/ctrf";

/**
Expand Down
1 change: 1 addition & 0 deletions src/methods/read-reports.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// TO BE REMOVED, WILL USE THE CTRF LIBRARY INSTEAD
import fs from 'fs';
import path from 'path';
import { CtrfReport } from '../../types/ctrf';
Expand Down