File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
sources/testrails-source/src/testrails Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import {
11
11
PagedResponse ,
12
12
PagedResults ,
13
13
PagedRuns ,
14
+ PagedSuites ,
14
15
PagedTests ,
15
16
TestRailsCase ,
16
17
TestRailsCaseType ,
@@ -96,8 +97,16 @@ export class TestRailsClient {
96
97
* @param projectId The project to retrieve suites for
97
98
* @returns The TestRails suites
98
99
*/
100
+ @Memoize ( )
99
101
async listSuites ( projectId : string ) : Promise < TestRailsSuite [ ] > {
100
- return this . get ( `/get_suites/${ projectId } ` ) ;
102
+ const suites = [ ] ;
103
+ for await ( const suite of this . paginate (
104
+ `/get_suites/${ projectId } ` ,
105
+ ( res : PagedSuites ) => res . suites
106
+ ) ) {
107
+ suites . push ( suite ) ;
108
+ }
109
+ return suites ;
101
110
}
102
111
103
112
/**
Original file line number Diff line number Diff line change @@ -38,6 +38,10 @@ export interface TestRailsSuite {
38
38
readonly completed_on : number ;
39
39
}
40
40
41
+ export interface PagedSuites extends PagedResponse {
42
+ readonly suites : TestRailsSuite [ ] ;
43
+ }
44
+
41
45
export interface TestRailsCase {
42
46
readonly id : number ;
43
47
readonly title : string ;
You can’t perform that action at this time.
0 commit comments