| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3bfce6c commit 070577e
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2226,10 +2226,10 @@ test('mocks setTimeout to be executed synchronously without having to actually w | |||
| 2226 | 2226 | const nineSecs = 9000; | |
| 2227 | 2227 | setTimeout(fn, nineSecs); | |
| 2228 | 2228 | ||
| 2229 | - const twoSeconds = 3000; | ||
| 2230 | - context.mock.timers.tick(twoSeconds); | ||
| 2231 | - context.mock.timers.tick(twoSeconds); | ||
| 2232 | - context.mock.timers.tick(twoSeconds); | ||
| 2229 | + const threeSeconds = 3000; | ||
| 2230 | + context.mock.timers.tick(threeSeconds); | ||
| 2231 | + context.mock.timers.tick(threeSeconds); | ||
| 2232 | + context.mock.timers.tick(threeSeconds); | ||
| 2233 | 2233 | ||
| 2234 | 2234 | assert.strictEqual(fn.mock.callCount(), 1); | |
| 2235 | 2235 | }); | |
@@ -2245,10 +2245,10 @@ test('mocks setTimeout to be executed synchronously without having to actually w | |||
| 2245 | 2245 | const nineSecs = 9000; | |
| 2246 | 2246 | setTimeout(fn, nineSecs); | |
| 2247 | 2247 | ||
| 2248 | - const twoSeconds = 3000; | ||
| 2249 | - context.mock.timers.tick(twoSeconds); | ||
| 2250 | - context.mock.timers.tick(twoSeconds); | ||
| 2251 | - context.mock.timers.tick(twoSeconds); | ||
| 2248 | + const threeSeconds = 3000; | ||
| 2249 | + context.mock.timers.tick(threeSeconds); | ||
| 2250 | + context.mock.timers.tick(threeSeconds); | ||
| 2251 | + context.mock.timers.tick(threeSeconds); | ||
| 2252 | 2252 | ||
| 2253 | 2253 | assert.strictEqual(fn.mock.callCount(), 1); | |
| 2254 | 2254 | }); | |
@@ -2298,8 +2298,8 @@ test('mocks setTimeout to be executed synchronously without having to actually w | |||
| 2298 | 2298 | ||
| 2299 | 2299 | #### Using clear functions | |
| 2300 | 2300 | ||
| 2301 | - As mentioned, all clear functions from timers (`clearTimeout` and `clearInterval`) | ||
| 2302 | - are implicity mocked. Take a look at this example using `setTimeout`: | ||
| 2301 | + As mentioned, all clear functions from timers (`clearTimeout`, `clearInterval`,and | ||
| 2302 | + `clearImmediate`) are implicitly mocked. Take a look at this example using `setTimeout`: | ||
| 2303 | 2303 | ||
| 2304 | 2304 | ```mjs | |
| 2305 | 2305 | import assert from 'node:assert'; | |
@@ -2312,7 +2312,7 @@ test('mocks setTimeout to be executed synchronously without having to actually w | |||
| 2312 | 2312 | context.mock.timers.enable({ apis: ['setTimeout'] }); | |
| 2313 | 2313 | const id = setTimeout(fn, 9999); | |
| 2314 | 2314 | ||
| 2315 | - // Implicity mocked as well | ||
| 2315 | + // Implicitly mocked as well | ||
| 2316 | 2316 | clearTimeout(id); | |
| 2317 | 2317 | context.mock.timers.tick(9999); | |
| 2318 | 2318 | ||
@@ -2332,7 +2332,7 @@ test('mocks setTimeout to be executed synchronously without having to actually w | |||
| 2332 | 2332 | context.mock.timers.enable({ apis: ['setTimeout'] }); | |
| 2333 | 2333 | const id = setTimeout(fn, 9999); | |
| 2334 | 2334 | ||
| 2335 | - // Implicity mocked as well | ||
| 2335 | + // Implicitly mocked as well | ||
| 2336 | 2336 | clearTimeout(id); | |
| 2337 | 2337 | context.mock.timers.tick(9999); | |
| 2338 | 2338 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments