|
414 | 414 | // |
415 | 415 | // COSTS, so the next person extending this list knows what they buy: an |
416 | 416 | // externalised package cannot be `vi.mock`ed and is not instrumented for |
417 | | -// coverage. Both were checked against this package when the entry landed — |
418 | | -// `packages/cli` has no `vi.mock` of `@objectstack/types` (its only mock targets |
419 | | -// are `../utils/optional-package.js`, `node:fs/promises` and |
420 | | -// `@objectstack/cloud-connection`) — but neither is free, and a package added |
421 | | -// here later must be re-checked for both. |
| 417 | +// coverage. Both were checked against this package when the entry landed, and |
| 418 | +// a package added here later must be re-checked for both — so the census that |
| 419 | +// re-check starts from is stated below, on the commit it was taken on. |
| 420 | +// |
| 421 | +// ## THE MOCK-TARGET CENSUS (#13873) — 55519d5036, 2026-08-31 |
| 422 | +// |
| 423 | +// `@objectstack/types`, the one package externalised below, is NOT mocked here. |
| 424 | +// Zero sites — and the zero is not vacuous: 10 test files import it (both |
| 425 | +// `@objectstack/types` and `@objectstack/types/node`), so a mock of it is a |
| 426 | +// thing that could exist here and does not. That half has held since #11775. |
| 427 | +// |
| 428 | +// What a reader externalising something ELSE needs: 11 mock sites over 8 |
| 429 | +// distinct targets. Five are relative or node-builtin specifiers, which this |
| 430 | +// predicate cannot reach. THREE are workspace packages, which it can: |
| 431 | +// |
| 432 | +// @objectstack/cloud-connection src/commands/doctor-ledger-read-failure.test.ts |
| 433 | +// @objectstack/platform-objects/plugin src/commands/secret/orphans.guards.test.ts |
| 434 | +// @objectstack/lint test/i18n-flow-screen-coverage.test.ts |
| 435 | +// |
| 436 | +// ⭐ THREE, not the one this paragraph named until #13873 — and naming one was |
| 437 | +// worse than naming none. The sentence above sends the reader here to do a |
| 438 | +// re-check and then tells them what they will find, so a reader who trusted it |
| 439 | +// concluded that externalising a workspace package is free of mock conflicts in |
| 440 | +// this package. Externalising any of the three breaks the file that mocks it, |
| 441 | +// with an error pointing at that test rather than at the entry below that |
| 442 | +// caused it. Same shape as #12529 on this file. |
| 443 | +// |
| 444 | +// ⚠️ RE-TAKING IT: match the capital M, or you silently lose a third of the |
| 445 | +// census and get a plausible number back. |
| 446 | +// |
| 447 | +// git grep -nE "vi[.](do)?[Mm]ock[(]" -- 'packages/cli/**/*.test.ts' |
| 448 | +// |
| 449 | +// `vi.(do)?mock(` — the obvious spelling — matches no `vi.doMock` call at all, |
| 450 | +// so it drops all four `doMock` sites, among them `@objectstack/cloud-connection`: |
| 451 | +// the ONE workspace package the old parenthesis did name. #13873 shipped that |
| 452 | +// spelling as its reproduce command while its table was taken another way, and |
| 453 | +// the two disagree by exactly those two targets — re-run on the card's own |
| 454 | +// commit, the command returns 6 where the table says 8. Whoever re-takes this: |
| 455 | +// print your commit here, and keep the census in exactly one place in this |
| 456 | +// file (#12499). |
422 | 457 | // |
423 | 458 | // ## WHY THE SPAWN SWAP IS NOT THIS GATE'S TRADE TO REFUSE (#11707, #12460) |
424 | 459 | // |
|
0 commit comments