1
1
# CTRF CLI
2
2
3
- Various CTRF utilities available programatically and by command line
3
+ Various CTRF utilities available from the command line
4
4
5
5
<div align =" center " >
6
6
<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
39
39
To merge CTRF reports in a specified directory, use the following command:
40
40
41
41
``` sh
42
- npx ctrf merge < directory>
42
+ npx ctrf-cli merge < directory>
43
43
```
44
44
45
45
Replace ` 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
49
49
-o, --output ` filename ` : Output file name for the merged report. Default is ctrf-report.json.
50
50
51
51
``` sh
52
- npx ctrf merge < directory> --output my-merged-report.json
52
+ npx ctrf-cli merge < directory> --output my-merged-report.json
53
53
```
54
54
55
55
-d, --output-dir ` directory ` : Output directory for the merged report. Default is the same directory as the input reports.
56
56
57
57
``` sh
58
- npx ctrf merge < directory> --output-dir /path/to/output
58
+ npx ctrf-cli merge < directory> --output-dir /path/to/output
59
59
```
60
60
61
61
-k, --keep-reports: Keep existing reports after merging. By default, the original reports will be deleted after merging.
62
62
63
63
``` sh
64
- npx ctrf merge < directory> --keep-reports
64
+ npx ctrf-cli merge < directory> --keep-reports
65
65
```
66
66
67
67
## Flaky
72
72
To output flaky tests, use the following command:
73
73
74
74
``` sh
75
- npx ctrf flaky < file-path>
75
+ npx ctrf-cli flaky < file-path>
76
76
```
77
77
78
78
Replace <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:
87
87
- Test Name: Test 1, Retries: 2
88
88
```
89
89
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
-
106
90
## What is CTRF?
107
91
108
92
CTRF is a universal JSON test report schema that addresses the lack of a standardized format for JSON test reports.
0 commit comments