()
| 377 | var execCalls; |
| 378 | |
| 379 | function loadProtocolWithSpy() { |
| 380 | // Rig the require cache so a2aProtocol picks up our spy executeForceUpdate |
| 381 | // instead of the real one. Mirrors the approach used in |
| 382 | // forceUpdateLastUpdateReport.test.js (see top-of-file cache rig there). |
| 383 | delete require.cache[a2aProtocolPath]; |
| 384 | const realFU = require('../src/forceUpdate'); |
| 385 | require.cache[forceUpdatePath] = { |
| 386 | id: forceUpdatePath, |
| 387 | filename: forceUpdatePath, |
| 388 | loaded: true, |
| 389 | exports: { |
| 390 | executeForceUpdate: function (fu) { |
| 391 | execCalls.push(fu); |
| 392 | // For no-op tests, return realFU.FORCE_UPDATE_NOOP — that's what the |
| 393 | // real implementation would return when current === required. |
| 394 | if (execReturn === '__NOOP__') return realFU.FORCE_UPDATE_NOOP; |
| 395 | return execReturn; |
| 396 | }, |
| 397 | FORCE_UPDATE_NOOP: realFU.FORCE_UPDATE_NOOP, |
| 398 | }, |
| 399 | }; |
| 400 | return require('../src/gep/a2aProtocol'); |
| 401 | } |
| 402 | |
| 403 | before(() => { |
| 404 | if (!process.env.A2A_NODE_SECRET) process.env.A2A_NODE_SECRET = 'a'.repeat(64); |
no outgoing calls
no test coverage detected