Skip to content

Commit 48d7f6a

Browse files
committed
fix docs for getters
1 parent 0bca261 commit 48d7f6a

File tree

1 file changed

+48
-12
lines changed

1 file changed

+48
-12
lines changed

lib/result.js

Lines changed: 48 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,16 @@ class Result {
4141
duration: 0,
4242
}
4343

44-
/** @type {CodeceptJS.Test[]} */
44+
/**
45+
* @type {CodeceptJS.Test[]}
46+
* @private
47+
*/
4548
this._tests = []
4649

47-
/** @type {string[][]} */
50+
/**
51+
* @type {string[][]}
52+
* @private
53+
*/
4854
this._failures = []
4955
}
5056

@@ -63,35 +69,50 @@ class Result {
6369
}
6470

6571
/**
66-
* @returns {boolean} Whether this result contains any failed tests.
72+
* Whether this result contains any failed tests.
73+
*
74+
* @type {boolean}
75+
* @readonly
6776
*/
6877
get hasFailed() {
6978
return this._stats.failures > 0
7079
}
7180

7281
/**
73-
* @returns {CodeceptJS.Test[]} All collected tests.
82+
* All collected tests.
83+
*
84+
* @type {CodeceptJS.Test[]}
85+
* @readonly
7486
*/
7587
get tests() {
7688
return this._tests
7789
}
7890

7991
/**
80-
* @returns {string[][]} The failure reports (array aof strings per failed test).
92+
* The failure reports (array of strings per failed test).
93+
*
94+
* @type {string[][]}
95+
* @readonly
8196
*/
8297
get failures() {
8398
return this._failures.filter(f => f && (!Array.isArray(f) || f.length > 0))
8499
}
85100

86101
/**
87-
* @returns {Stats} The test statistics.
102+
* The test statistics.
103+
*
104+
* @type {Stats}
105+
* @readonly
88106
*/
89107
get stats() {
90108
return this._stats
91109
}
92110

93111
/**
94-
* @returns {Date} The start time of the test run.
112+
* The start time of the test run.
113+
*
114+
* @type {Date}
115+
* @readonly
95116
*/
96117
get startTime() {
97118
return this._startTime
@@ -122,35 +143,50 @@ class Result {
122143
}
123144

124145
/**
125-
* @returns {boolean} Whether this result contains any failed tests.
146+
* Whether this result contains any failed tests.
147+
*
148+
* @type {boolean}
149+
* @readonly
126150
*/
127151
get hasFailures() {
128152
return this.stats.failures > 0
129153
}
130154

131155
/**
132-
* @returns {number} The duration of the test run, in milliseconds.
156+
* The duration of the test run, in milliseconds.
157+
*
158+
* @type {number}
159+
* @readonly
133160
*/
134161
get duration() {
135162
return this._endTime ? +this._endTime - +this._startTime : 0
136163
}
137164

138165
/**
139-
* @returns {CodeceptJS.Test[]} All failed tests.
166+
* All failed tests.
167+
*
168+
* @type {CodeceptJS.Test[]}
169+
* readonly
140170
*/
141171
get failedTests() {
142172
return this._tests.filter(test => test.state === 'failed')
143173
}
144174

145175
/**
146-
* @returns {CodeceptJS.Test[]} All passed tests.
176+
* All passed tests.
177+
*
178+
* @type {CodeceptJS.Test[]}
179+
* @readonly
147180
*/
148181
get passedTests() {
149182
return this._tests.filter(test => test.state === 'passed')
150183
}
151184

152185
/**
153-
* @returns {CodeceptJS.Test[]} All skipped tests.
186+
* All skipped tests.
187+
*
188+
* @type {CodeceptJS.Test[]}
189+
* @readonly
154190
*/
155191
get skippedTests() {
156192
return this._tests.filter(test => test.state === 'skipped' || test.state === 'pending')

0 commit comments

Comments
 (0)