@@ -140,7 +140,7 @@ class MockTracker {
140
140
#mocks = [ ] ;
141
141
#timers;
142
142
143
- /**
143
+ /**.
144
144
* Returns the mock timers of this MockTracker instance.
145
145
* @returns {MockTimers } The mock timers instance.
146
146
*/
@@ -158,13 +158,13 @@ class MockTracker {
158
158
* @returns {ProxyConstructor } The mock function tracker.
159
159
*/
160
160
fn (
161
- original = function ( ) { } ,
161
+ original = function ( ) { } ,
162
162
implementation = original ,
163
163
options = kEmptyObject ,
164
164
) {
165
165
if ( original !== null && typeof original === 'object' ) {
166
166
options = original ;
167
- original = function ( ) { } ;
167
+ original = function ( ) { } ;
168
168
implementation = original ;
169
169
} else if ( implementation !== null && typeof implementation === 'object' ) {
170
170
options = implementation ;
@@ -272,11 +272,14 @@ class MockTracker {
272
272
}
273
273
274
274
/**
275
- * Mocks a getter method of an object.
275
+ * Mocks a getter method of an object. This is a syntax sugar for the MockTracker.method with options.getter set to true
276
276
* @param {Object } object - The target object.
277
277
* @param {string } methodName - The name of the getter method to be mocked.
278
278
* @param {function } [implementation] - An optional replacement function for the targeted method.
279
279
* @param {Object } [options] - Additional tracking options.
280
+ * @param {boolean } [options.getter=true] - Indicates whether this is a getter method.
281
+ * @param {boolean } [options.setter=false] - Indicates whether this is a setter method.
282
+ * @param {number } [options.times=Infinity] - The maximum number of times the mock method can be called.
280
283
* @returns {ProxyConstructor } The mock method tracker.
281
284
*/
282
285
getter (
@@ -308,11 +311,14 @@ class MockTracker {
308
311
}
309
312
310
313
/**
311
- * Mocks a setter method of an object.
314
+ * Mocks a setter method of an object. This function is a syntax sugar for MockTracker.method with options.setter set to true.
312
315
* @param {Object } object - The target object.
313
316
* @param {string } methodName - The setter method to be mocked.
314
317
* @param {function } [implementation] - An optional replacement function for the targeted method.
315
318
* @param {Object } [options] - Additional tracking options.
319
+ * @param {boolean } [options.getter=false] - Indicates whether this is a getter method.
320
+ * @param {boolean } [options.setter=true] - Indicates whether this is a setter method.
321
+ * @param {number } [options.times=Infinity] - The maximum number of times the mock method can be called.
316
322
* @returns {ProxyConstructor } The mock method tracker.
317
323
*/
318
324
setter (
0 commit comments