11# CTRF CLI
22
3- Various CTRF utilities available programatically and by command line
3+ Various CTRF utilities available from the command line
44
55<div align =" center " >
66<div style =" padding : 1.5rem ; border-radius : 8px ; margin : 1rem 0 ; border : 1px solid #30363d ;" >
@@ -39,7 +39,7 @@ This might be useful if you need a single report, but your chosen reporter gener
3939To merge CTRF reports in a specified directory, use the following command:
4040
4141``` sh
42- npx ctrf merge < directory>
42+ npx ctrf-cli merge < directory>
4343```
4444
4545Replace ` directory ` with the path to the directory containing the CTRF reports you want to merge.
@@ -49,19 +49,19 @@ Replace `directory` with the path to the directory containing the CTRF reports y
4949-o, --output ` filename ` : Output file name for the merged report. Default is ctrf-report.json.
5050
5151``` sh
52- npx ctrf merge < directory> --output my-merged-report.json
52+ npx ctrf-cli merge < directory> --output my-merged-report.json
5353```
5454
5555-d, --output-dir ` directory ` : Output directory for the merged report. Default is the same directory as the input reports.
5656
5757``` sh
58- npx ctrf merge < directory> --output-dir /path/to/output
58+ npx ctrf-cli merge < directory> --output-dir /path/to/output
5959```
6060
6161-k, --keep-reports: Keep existing reports after merging. By default, the original reports will be deleted after merging.
6262
6363``` sh
64- npx ctrf merge < directory> --keep-reports
64+ npx ctrf-cli merge < directory> --keep-reports
6565```
6666
6767## Flaky
7272To output flaky tests, use the following command:
7373
7474``` sh
75- npx ctrf flaky < file-path>
75+ npx ctrf-cli flaky < file-path>
7676```
7777
7878Replace <file-path > with the path to the CTRF report file you want to analyze.
@@ -87,22 +87,6 @@ Found 1 flaky test(s) in reports/sample-report.json:
8787- Test Name: Test 1, Retries: 2
8888```
8989
90- ## Programmatic Methods
91-
92- ``` sh
93- npm install ctrf
94- ```
95-
96- The following programmatic methods are available:
97-
98- ` mergeReports ` - This method merges multiple CTRF reports into a single report.
99-
100- ` readSingleReport ` - Reads and parses a single CTRF report file from a specified file path.
101-
102- ` readReportsFromDirectory ` - Reads all CTRF report files from a given directory.
103-
104- ` readReportsFromGlobPattern ` - Reads all CTRF report files from a given glob pattern.
105-
10690## What is CTRF?
10791
10892CTRF is a universal JSON test report schema that addresses the lack of a standardized format for JSON test reports.
0 commit comments