| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 698ea7a commit 41b08bd
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2098,10 +2098,10 @@ test('mocks setTimeout to be executed synchronously without having to actually w | |||
| 2098 | 2098 | const nineSecs = 9000; | |
| 2099 | 2099 | setTimeout(fn, nineSecs); | |
| 2100 | 2100 | ||
| 2101 | - const twoSeconds = 3000; | ||
| 2102 | - context.mock.timers.tick(twoSeconds); | ||
| 2103 | - context.mock.timers.tick(twoSeconds); | ||
| 2104 | - context.mock.timers.tick(twoSeconds); | ||
| 2101 | + const threeSeconds = 3000; | ||
| 2102 | + context.mock.timers.tick(threeSeconds); | ||
| 2103 | + context.mock.timers.tick(threeSeconds); | ||
| 2104 | + context.mock.timers.tick(threeSeconds); | ||
| 2105 | 2105 | ||
| 2106 | 2106 | assert.strictEqual(fn.mock.callCount(), 1); | |
| 2107 | 2107 | }); | |
@@ -2117,10 +2117,10 @@ test('mocks setTimeout to be executed synchronously without having to actually w | |||
| 2117 | 2117 | const nineSecs = 9000; | |
| 2118 | 2118 | setTimeout(fn, nineSecs); | |
| 2119 | 2119 | ||
| 2120 | - const twoSeconds = 3000; | ||
| 2121 | - context.mock.timers.tick(twoSeconds); | ||
| 2122 | - context.mock.timers.tick(twoSeconds); | ||
| 2123 | - context.mock.timers.tick(twoSeconds); | ||
| 2120 | + const threeSeconds = 3000; | ||
| 2121 | + context.mock.timers.tick(threeSeconds); | ||
| 2122 | + context.mock.timers.tick(threeSeconds); | ||
| 2123 | + context.mock.timers.tick(threeSeconds); | ||
| 2124 | 2124 | ||
| 2125 | 2125 | assert.strictEqual(fn.mock.callCount(), 1); | |
| 2126 | 2126 | }); | |
@@ -2170,8 +2170,8 @@ test('mocks setTimeout to be executed synchronously without having to actually w | |||
| 2170 | 2170 | ||
| 2171 | 2171 | #### Using clear functions | |
| 2172 | 2172 | ||
| 2173 | - As mentioned, all clear functions from timers (`clearTimeout` and `clearInterval`) | ||
| 2174 | - are implicity mocked. Take a look at this example using `setTimeout`: | ||
| 2173 | + As mentioned, all clear functions from timers (`clearTimeout`, `clearInterval`,and | ||
| 2174 | + `clearImmediate`) are implicitly mocked. Take a look at this example using `setTimeout`: | ||
| 2175 | 2175 | ||
| 2176 | 2176 | ```mjs | |
| 2177 | 2177 | import assert from 'node:assert'; | |
@@ -2184,7 +2184,7 @@ test('mocks setTimeout to be executed synchronously without having to actually w | |||
| 2184 | 2184 | context.mock.timers.enable({ apis: ['setTimeout'] }); | |
| 2185 | 2185 | const id = setTimeout(fn, 9999); | |
| 2186 | 2186 | ||
| 2187 | - // Implicity mocked as well | ||
| 2187 | + // Implicitly mocked as well | ||
| 2188 | 2188 | clearTimeout(id); | |
| 2189 | 2189 | context.mock.timers.tick(9999); | |
| 2190 | 2190 | ||
@@ -2204,7 +2204,7 @@ test('mocks setTimeout to be executed synchronously without having to actually w | |||
| 2204 | 2204 | context.mock.timers.enable({ apis: ['setTimeout'] }); | |
| 2205 | 2205 | const id = setTimeout(fn, 9999); | |
| 2206 | 2206 | ||
| 2207 | - // Implicity mocked as well | ||
| 2207 | + // Implicitly mocked as well | ||
| 2208 | 2208 | clearTimeout(id); | |
| 2209 | 2209 | context.mock.timers.tick(9999); | |
| 2210 | 2210 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments