(result, method)
| 173 | } |
| 174 | |
| 175 | async runForLoopSync(result, method) { |
| 176 | { |
| 177 | const hook = this.createHook([], `${method}None`); |
| 178 | result[`${method}None`] = await this.gainResult((cb) => hook[method](cb)); |
| 179 | } |
| 180 | |
| 181 | { |
| 182 | const hook = this.createHook(["arg"], `${method}NoneWithArg`); |
| 183 | result[`${method}NoneWithArg`] = await this.gainResult((cb) => |
| 184 | hook[method](42, cb) |
| 185 | ); |
| 186 | } |
| 187 | |
| 188 | { |
| 189 | const hook = this.createHook([], `${method}SingleSync`); |
| 190 | hook.tap("sync", () => { |
| 191 | result[`${method}SingleSyncCalled`] = |
| 192 | (result[`${method}SingleSyncCalled`] || 0) + 1; |
| 193 | if (result[`${method}SingleSyncCalled`] < 42) return true; |
| 194 | }); |
| 195 | result[`${method}SingleSync`] = await this.gainResult((cb) => |
| 196 | hook[method](cb) |
| 197 | ); |
| 198 | } |
| 199 | |
| 200 | { |
| 201 | const hook = this.createHook([], `${method}MultipleSync`); |
| 202 | hook.tap("sync1", () => { |
| 203 | result[`${method}MultipleSyncCalled1`] = |
| 204 | (result[`${method}MultipleSyncCalled1`] || 0) + 1; |
| 205 | if (result[`${method}MultipleSyncCalled1`] < 42) return true; |
| 206 | }); |
| 207 | hook.tap("sync2", () => { |
| 208 | result[`${method}MultipleSyncCalled2`] = |
| 209 | (result[`${method}MultipleSyncCalled2`] || 0) + 1; |
| 210 | if (result[`${method}MultipleSyncCalled2`] < 42) return true; |
| 211 | }); |
| 212 | result[`${method}MultipleSync`] = await this.gainResult((cb) => |
| 213 | hook[method](cb) |
| 214 | ); |
| 215 | } |
| 216 | |
| 217 | { |
| 218 | const hook = this.createHook([], `${method}InterceptedSync`); |
| 219 | hook.tap("sync1", () => { |
| 220 | result[`${method}InterceptedSyncCalled1`] = |
| 221 | (result[`${method}InterceptedSyncCalled1`] || 0) + 1; |
| 222 | if (result[`${method}InterceptedSyncCalled1`] < 42) return true; |
| 223 | }); |
| 224 | hook.tap("sync2", () => { |
| 225 | result[`${method}InterceptedSyncCalled2`] = |
| 226 | (result[`${method}InterceptedSyncCalled2`] || 0) + 1; |
| 227 | if (result[`${method}InterceptedSyncCalled2`] < 42) return true; |
| 228 | }); |
| 229 | hook.intercept({ |
| 230 | call: (_a) => |
| 231 | (result[`${method}InterceptedSyncCalledCall`] = |
| 232 | (result[`${method}InterceptedSyncCalledCall`] || 0) + 1), |
no test coverage detected