File tree 3 files changed +20
-14
lines changed
3 files changed +20
-14
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ Context.prototype.runnable = function (runnable) {
29
29
} ;
30
30
31
31
/**
32
- * Set test timeout `ms`.
32
+ * Set or get test timeout `ms`.
33
33
*
34
34
* @api private
35
35
* @param {number } ms
@@ -44,25 +44,31 @@ Context.prototype.timeout = function (ms) {
44
44
} ;
45
45
46
46
/**
47
- * Set test timeout `enabled`.
47
+ * Set or get test timeout `enabled`.
48
48
*
49
49
* @api private
50
50
* @param {boolean } enabled
51
51
* @return {Context } self
52
52
*/
53
53
Context . prototype . enableTimeouts = function ( enabled ) {
54
+ if ( ! arguments . length ) {
55
+ return this . runnable ( ) . enableTimeouts ( ) ;
56
+ }
54
57
this . runnable ( ) . enableTimeouts ( enabled ) ;
55
58
return this ;
56
59
} ;
57
60
58
61
/**
59
- * Set test slowness threshold `ms`.
62
+ * Set or get test slowness threshold `ms`.
60
63
*
61
64
* @api private
62
65
* @param {number } ms
63
66
* @return {Context } self
64
67
*/
65
68
Context . prototype . slow = function ( ms ) {
69
+ if ( ! arguments . length ) {
70
+ return this . runnable ( ) . slow ( ) ;
71
+ }
66
72
this . runnable ( ) . slow ( ms ) ;
67
73
return this ;
68
74
} ;
@@ -78,7 +84,7 @@ Context.prototype.skip = function () {
78
84
} ;
79
85
80
86
/**
81
- * Allow a number of retries on failed tests
87
+ * Set or get a number of allowed retries on failed tests
82
88
*
83
89
* @api private
84
90
* @param {number } n
Original file line number Diff line number Diff line change @@ -91,14 +91,14 @@ Runnable.prototype.timeout = function (ms) {
91
91
} ;
92
92
93
93
/**
94
- * Set & get slow `ms`.
94
+ * Set or get slow `ms`.
95
95
*
96
96
* @api private
97
97
* @param {number|string } ms
98
98
* @return {Runnable|number } ms or Runnable instance.
99
99
*/
100
100
Runnable . prototype . slow = function ( ms ) {
101
- if ( typeof ms === 'undefined' ) {
101
+ if ( ! arguments . length || typeof ms === 'undefined' ) {
102
102
return this . _slow ;
103
103
}
104
104
if ( typeof ms === 'string' ) {
@@ -144,7 +144,7 @@ Runnable.prototype.isPending = function () {
144
144
} ;
145
145
146
146
/**
147
- * Set number of retries.
147
+ * Set or get number of retries.
148
148
*
149
149
* @api private
150
150
*/
@@ -156,7 +156,7 @@ Runnable.prototype.retries = function (n) {
156
156
} ;
157
157
158
158
/**
159
- * Get current retry
159
+ * Set or get current retry
160
160
*
161
161
* @api private
162
162
*/
@@ -242,7 +242,7 @@ Runnable.prototype.resetTimeout = function () {
242
242
} ;
243
243
244
244
/**
245
- * Whitelist a list of globals for this test run.
245
+ * Set or get a list of whitelisted globals for this test run.
246
246
*
247
247
* @api private
248
248
* @param {string[] } globals
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ Suite.prototype.clone = function () {
92
92
} ;
93
93
94
94
/**
95
- * Set timeout `ms` or short-hand such as "2s".
95
+ * Set or get timeout `ms` or short-hand such as "2s".
96
96
*
97
97
* @api private
98
98
* @param {number|string } ms
@@ -114,7 +114,7 @@ Suite.prototype.timeout = function (ms) {
114
114
} ;
115
115
116
116
/**
117
- * Set number of times to retry a failed test.
117
+ * Set or get number of times to retry a failed test.
118
118
*
119
119
* @api private
120
120
* @param {number|string } n
@@ -130,7 +130,7 @@ Suite.prototype.retries = function (n) {
130
130
} ;
131
131
132
132
/**
133
- * Set timeout to `enabled`.
133
+ * Set or get timeout to `enabled`.
134
134
*
135
135
* @api private
136
136
* @param {boolean } enabled
@@ -146,7 +146,7 @@ Suite.prototype.enableTimeouts = function (enabled) {
146
146
} ;
147
147
148
148
/**
149
- * Set slow `ms` or short-hand such as "2s".
149
+ * Set or get slow `ms` or short-hand such as "2s".
150
150
*
151
151
* @api private
152
152
* @param {number|string } ms
@@ -165,7 +165,7 @@ Suite.prototype.slow = function (ms) {
165
165
} ;
166
166
167
167
/**
168
- * Sets whether to bail after first error.
168
+ * Sets or gets whether to bail after first error.
169
169
*
170
170
* @api private
171
171
* @param {boolean } bail
You can’t perform that action at this time.
0 commit comments