Repository navigation
test: 100% coverage, enforced in CI - #40
Merged
Merged
Conversation
FROM public."Orders" read as "" and JOIN [dbo].[Customers] as "dbo", so saved queries written that way were never offered as AI examples.
applyDefaultLimit / applyDefaultLimitMssql looked for LIMIT n, TOP n and FETCH FIRST in the raw SQL, so WHERE note = 'LIMIT 3' (or a comment) skipped the automatic limit. Check the scanned text instead.
With no days of data BarChart fell back to an empty date and rendered "peak 0 · Jan undefined". It now shows no peak until there is data.
Adds component tests (jsdom + Testing Library, renderUi in src/utils/dom.testing.tsx) and fills the server, utils, store and mcp-bridge gaps. npm test now runs with coverage and vite.config.ts sets 100% thresholds, so CI and pre-push fail on any uncovered line.
Fallbacks and guards that duplicate an earlier check (a disabled button, an exhaustive validator, a value that always has a default) are deleted where truly dead. Write-path fallbacks are kept and now tested. No validation, capability, masking or production-rail check changes.
A connection-modal test typed past the 5 s default on CI. Type without per-key delays and raise testTimeout to 20 s.
|
🎉 This PR is included in version 2.7.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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
src/,server/,public/*.mjsandvite.pwa.config.ts. That is 2,415 tests in 160 files.npm testnow runs with coverage andvite.config.tssets 100% thresholds, so CI andpre-pushfail on any uncovered line..claude/rules/test-coverage.md(loaded every session, with a pointer inCLAUDE.md): new code always ships at 100%, with nov8 ignorecomments, plus how to handle an unreachable branch.testTimeoutis 20 s and user-event types without per-key delay, because one modal test passed the 5 s default on CI.Bug fixes found along the way
Each fix has a regression test that fails on the old code.
LIMIT n,TOP norFETCH FIRST, e.g.WHERE note = 'LIMIT 3'.public."Orders"and[dbo].[Customers].Test setup
@vitest/coverage-v8,jsdom(pinned to^29because jsdom 30 needs Node 22 and CI runs Node 20), and@testing-library/{react,dom,user-event}.renderUifromsrc/utils/dom.testing.tsx(Mantine, router and jsdom stubs). Monaco and AG Grid are replaced with fakes that record their props.fireReactHandler(src/utils/react-handler.testing.ts) calls a disabled button's handler directly, so guards behind disabled buttons are tested instead of left uncovered.Refactor: unreachable branches
About 120 lines were guards that no input could reach.
?? "invalid"on a zod error, which always has a message.WriteRequestDetailis split so its sixif (!id)guards are no longer needed.Test plan
npm run verifyandnpm run buildpassnpm testfail on the threshold'LIMIT 3'in a string; a realLIMIT 4and the no-limit setting are unchanged.🤖 Generated with Claude Code