()
| 327 | } |
| 328 | |
| 329 | get assert() { |
| 330 | if (this.#assert === undefined) { |
| 331 | const { plan } = this.#test; |
| 332 | const map = lazyAssertObject(this.#test.root.harness); |
| 333 | const assert = { __proto__: null }; |
| 334 | |
| 335 | this.#assert = assert; |
| 336 | map.forEach((method, name) => { |
| 337 | assert[name] = (...args) => { |
| 338 | if (plan !== null) { |
| 339 | plan.count(); |
| 340 | } |
| 341 | return ReflectApply(method, this, args); |
| 342 | }; |
| 343 | }); |
| 344 | |
| 345 | if (!map.has('ok')) { |
| 346 | // This is a hack. It allows the innerOk function to collect the |
| 347 | // stacktrace from the correct starting point. |
| 348 | function ok(...args) { |
| 349 | if (plan !== null) { |
| 350 | plan.count(); |
| 351 | } |
| 352 | innerOk(ok, ...args); |
| 353 | } |
| 354 | |
| 355 | assert.ok = ok; |
| 356 | } |
| 357 | } |
| 358 | return this.#assert; |
| 359 | } |
| 360 | |
| 361 | get mock() { |
| 362 | this.#test.mock ??= new MockTracker(); |
no test coverage detected