Found while implementing objectui#6252 (PR objectui#7180), whose third acceptance criterion is explicitly "measure it against the built artifact, not the source".
The gap
The root vitest.config.mts aliases every workspace package to its src:
'@object-ui/components': path.resolve(__dirname, './packages/components/src'),
That is correct for the ~2000 tests that want fast source feedback. The consequence is that no test in this repo observes its own package's built output unless it bypasses the alias with an explicit relative import of packages/<pkg>/dist/index.js.
Such a test cannot be committed today, because turbo.json's test task is:
"test": { "dependsOn": ["^build"], … }
^build builds the package's dependencies, not the package itself. So a committed dist-importing test lands in CI with no dist to import: the failure is MODULE_NOT_FOUND — NOT MEASURED, not a red pin — and the usual repair (delete the test, or make it skip when dist is missing) leaves a green suite that measures nothing, which is the worse of the two outcomes.
Measured, not assumed
The measurement objectui#7180 needed was run by hand and passes, so the capability exists — only the standing pin does not:
- a test importing
../../dist/index.js mounts the built page:header, resolves an id, and shows no body.source reaches the DOM or the authored node; - live control: with that one import removed the same file fails
expected undefined to be truthy — page:header is unregistered in the light dom project — which proves the passing run measured the built bundle and nothing else.
It was deliberately left uncommitted for the reason above, and the PR body records that.
Options (not a recommendation — this wants a ruling)
- A dedicated project (
dist) in vitest.config.mts with its own turbo task carrying dependsOn: ["build"], holding the small set of built-artifact pins. Costs one build in that job. - Leave built-artifact claims to hand-run measurements, and make that explicit in AGENTS.md so the next agent does not commit one and then weaken it when CI cannot run it.
- Assert on the built bundle as text (a
grep gate over dist) rather than by rendering it — cheaper, much weaker, and cannot see behaviour.
Why it matters beyond one card
"Does the shipped bundle still do X" is exactly the class of claim that source-resolved tests are structurally unable to answer, and this repo has the alias for good reasons. Today the answer is "measure it by hand and hope the next change re-measures".
Found while implementing objectui#6252 (PR objectui#7180), whose third acceptance criterion is explicitly "measure it against the built artifact, not the source".
The gap
The root
vitest.config.mtsaliases every workspace package to itssrc:That is correct for the ~2000 tests that want fast source feedback. The consequence is that no test in this repo observes its own package's built output unless it bypasses the alias with an explicit relative import of
packages/<pkg>/dist/index.js.Such a test cannot be committed today, because
turbo.json'stesttask is:^buildbuilds the package's dependencies, not the package itself. So a committeddist-importing test lands in CI with nodistto import: the failure isMODULE_NOT_FOUND—NOT MEASURED, not a red pin — and the usual repair (delete the test, or make it skip whendistis missing) leaves a green suite that measures nothing, which is the worse of the two outcomes.Measured, not assumed
The measurement objectui#7180 needed was run by hand and passes, so the capability exists — only the standing pin does not:
../../dist/index.jsmounts the builtpage:header, resolves an id, and shows nobody.sourcereaches the DOM or the authored node;expected undefined to be truthy—page:headeris unregistered in the lightdomproject — which proves the passing run measured the built bundle and nothing else.It was deliberately left uncommitted for the reason above, and the PR body records that.
Options (not a recommendation — this wants a ruling)
dist) invitest.config.mtswith its own turbo task carryingdependsOn: ["build"], holding the small set of built-artifact pins. Costs one build in that job.grepgate overdist) rather than by rendering it — cheaper, much weaker, and cannot see behaviour.Why it matters beyond one card
"Does the shipped bundle still do X" is exactly the class of claim that source-resolved tests are structurally unable to answer, and this repo has the alias for good reasons. Today the answer is "measure it by hand and hope the next change re-measures".