fix(scaffold): ship web projects test-ready (bun test + @types/bun)#12
Conversation
Generated web apps shipped with no test runner and no bun:test types, so when TDD enforcement required a test the model wasted turns hand-rolling a bun-test.d.ts and wiring a runner (seen in a real generated project). Both package.json templates (react + vanilla) now ship a "test": "bun test" script and @types/bun in devDependencies; installWebDeps installs them at scaffold time. The build guidance, which previously told the model not to write tests, now states the runner is already wired and that .ts logic needs a co-located bun:test *.test.ts while .tsx components stay test-free. Verified: tsc resolves bun:test with @types/bun and no hand-rolled .d.ts; detect-gate scaffold tests 18 pass.
There was a problem hiding this comment.
Code Review
This pull request adds a test script and Bun types to the React and Vanilla web templates, while updating the developer guidance to emphasize logic-based TDD using bun:test. However, the package @types/bun does not exist on npm and will cause installation failures. The feedback recommends replacing it with the official bun-types package, updating the TypeScript configurations accordingly, and adjusting the guidance text to avoid split import statements.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Problem
Generated web apps shipped with no test runner and no
bun:testtypes. So when TDD enforcement (default-on since 0.14.0) required a test for.tslogic, the model had to:src/bun-test.d.tsto getbun:testto type-check (TS2664/TS2307undermoduleResolution: bundler), andThis wasted real turns on a freshly generated project — exactly the headline use case.
Fix
packages/core/src/web-templates.ts:package.jsontemplates (react + vanilla) now ship"test": "bun test"and@types/bunindevDependencies.installWebDepsrunsbun install, so they're present at scaffold time.@types/bunis auto-included fromnode_modules/@types(notypesarray needed), soimport { test, expect } from "bun:test"resolves with zero hand-rolled.d.ts..tslogic needs a co-locatedbun:test*.test.ts, while presentational.tsxcomponents stay test-free.discoverTestCommandalready prefers a realtestscript, so the gate also recognizes/runs these tests.buildWebGatedoes not runbun test, so a freshly scaffolded app (test script present, no test files yet) won't fail the gate on zero tests — enforcement stays with thetest-sibling-requiredmeta-rule.Verification
moduleResolution: bundler, notypesarray) and only@types/bunadded — no hand-rolled.d.ts—tsc --noEmitis green (bun:testresolves) andbun testpasses (1 pass).detect-gate.test.ts(scaffold tests): 18 pass, 0 fail.