Skip to content

test: stop skipping the report/web unit suites in test:unit - #26

Merged
blimmer merged 2 commits into
mainfrom
fix/unit-test-discovery
May 27, 2026
Merged

test: stop skipping the report/web unit suites in test:unit#26
blimmer merged 2 commits into
mainfrom
fix/unit-test-discovery

Conversation

@blimmer

@blimmer blimmer commented May 27, 2026

Copy link
Copy Markdown
Contributor

Summary

bun run executes package scripts via /bin/sh, which has no globstar, so test:unit's bun test ./src/*.test.ts ./src/**/*.test.ts only reached ~2 directories deep and silently skipped every *.test.ts under src/report/web — 4 files / 18 tests, all the report analytics suites (postHogAnalytics, index, stableUrlRewriter, readEmbeddedAnalytics). just verify and CI were green without ever running them.

This swaps the hand-rolled globs for bun's native recursive discovery plus its --path-ignore-patterns flag to drop the one vitest browser suite (App.browser.test.tsx, which otherwise gets picked up and fails under bun:test). test:unit now runs 26 files (134 tests), up from 22 (116). vitest is untouched.

Review focus

Using bun's own discovery + --path-ignore-patterns rather than feeding it an explicit file list: no globstar dependency, not depth-fragile, no find (so no cross-platform wart), no helper script. The ignore glob is single-quoted so bun matches it internally rather than the shell expanding it.

Commits

  • 51817af — discover tests via bun + --path-ignore-patterns instead of a non-recursive shell glob

test:unit globbed `./src/*.test.ts ./src/**/*.test.ts`, but `bun run` executes
package scripts via /bin/sh (no globstar), so the pattern stopped a couple
directories deep and silently skipped every *.test.ts under src/report/web —
4 files / 18 tests, all the report analytics suites.

Let bun discover tests natively and ignore the vitest browser suite via its
--path-ignore-patterns flag. test:unit now runs 26 files (134 tests), up from 22.
@blimmer
blimmer enabled auto-merge (squash) May 27, 2026 20:33
@blimmer
blimmer merged commit 2515696 into main May 27, 2026
7 checks passed
@blimmer
blimmer deleted the fix/unit-test-discovery branch May 27, 2026 20:33
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