test: stop skipping the report/web unit suites in test:unit - #26
Merged
Conversation
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.
# Conflicts: # package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bun runexecutes package scripts via/bin/sh, which has no globstar, sotest:unit'sbun test ./src/*.test.ts ./src/**/*.test.tsonly reached ~2 directories deep and silently skipped every*.test.tsundersrc/report/web— 4 files / 18 tests, all the report analytics suites (postHogAnalytics,index,stableUrlRewriter,readEmbeddedAnalytics).just verifyand CI were green without ever running them.This swaps the hand-rolled globs for bun's native recursive discovery plus its
--path-ignore-patternsflag to drop the one vitest browser suite (App.browser.test.tsx, which otherwise gets picked up and fails underbun:test).test:unitnow runs 26 files (134 tests), up from 22 (116). vitest is untouched.Review focus
Using bun's own discovery +
--path-ignore-patternsrather than feeding it an explicit file list: no globstar dependency, not depth-fragile, nofind(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-patternsinstead of a non-recursive shell glob