Skip to content

chore: add vitest smoke tests and run them in CI (BITS-207) - #21

Merged
PhilReinking merged 4 commits into
mainfrom
chore/bits-207-vitest-smoke-tests
Oct 11, 2026
Merged

PhilReinking merged 4 commits into
mainfrom
chore/bits-207-vitest-smoke-tests

Conversation

@PhilReinking

@PhilReinking PhilReinking commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Adds vitest with a few smoke specs and runs npm test in the CI job, before the build. Fixes BITS-207

  • Specs live in tests/, outside src, so vue-tsc and the d.ts build skip them. They are not type-checked.
  • @vue/test-utils is pinned to 2.4.6: later versions need Vue 3.5, and the repo runs Vue 3.3.
  • tests/Icon.spec.ts registers faGithub itself, like an app will after BITS-206. If BITS-206 changes D9Icon's behaviour, its PR updates this spec.
  • Lockfile: magic-string stays at 0.30.5, so npm ls --omit=dev matches main. npm moved a few dev-only packages (glob, debug, ws) up.

Tested: test, check, build, dist type check. The Button, Select and brand-icon specs fail when I break the line they guard. dist is byte-identical to main's.

CI proof: red with a spec broken on purpose (1039334), green after the revert (d68a345).

Not tested: the Enter key. jsdom doesn't turn Enter into a click, so the loading spec clicks instead.

🤖 Generated with Claude Code

PhilReinking and others added 4 commits October 11, 2026 16:45
`npm test` runs vitest once (no watch) in jsdom. Smoke specs for D9Button
(disabled and loading), D9Select (outside modelValue change) and D9Icon
(brand icon, unknown name). The CI job runs `npm test` before the build.

@vue/test-utils is pinned to 2.4.6: later 2.4.x and 2.5 need Vue 3.5,
the repo runs Vue 3.3. The runtime tree (`npm ls --omit=dev`) and dist
are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ows)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ert follows)"

This reverts commit 1039334.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Apps register their own icons once BITS-206 lands, so the spec does the
same instead of relying on D9's built-in list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@PhilReinking
PhilReinking marked this pull request as ready for review October 11, 2026 14:53

@PhilReinking PhilReinking left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK at a38379b, CI green.

Checked beyond the PR text: the specs pass merged with current main (3d0d1f8, with the BITS-195 Select change). Ten one-line breaks in Button, Select and Icon each fail a spec. Runtime deps, npm ls --omit=dev, the audit and the packed files match main, so Input gets nothing new. The specs type-check clean with vue-tsc, so adding them to check later is cheap.

Comment thread tests/Icon.spec.ts

describe("D9Icon", () => {
it("renders a brand icon with the fab prefix", () => {
// Registered here like an app does, so the spec doesn't rely on D9's own icon list

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: today this library.add changes nothing. D9 already registers faGithub and brands is a snapshot, so the spec fails if faGithub leaves registerIcons.ts. It stops relying on D9's list once BITS-206 checks at render time.

Suggested change
// Registered here like an app does, so the spec doesn't rely on D9's own icon list
// Registered like an app does. Until BITS-206, D9's own list already has it.

@PhilReinking
PhilReinking merged commit 8757698 into main Oct 11, 2026
1 check passed
@PhilReinking
PhilReinking deleted the chore/bits-207-vitest-smoke-tests branch October 11, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant