Repository navigation
test: raise Vitest coverage above 75% across all metrics and fix RLS AST tests (#71) - #358
Open
dungfundopt wants to merge 1 commit into
Open
dungfundopt wants to merge 1 commit into
dungfundopt wants to merge 1 commit into
Conversation
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
Brings project-wide Vitest coverage well above the 75% threshold across every metric (Statements, Branches, Functions, and Lines) with meaningful behavior/edge-case tests and zero failing suites:
main): 4 failing tests insrc/rls/index.test.ts; Coverage: Stmts76.82%, Branches47.68%(below 75% threshold), Funcs82.10%, Lines77.17%.94.82%, Branches79.24%, Funcs94.77%, Lines95.13%.Key Changes
0%->96-100%):src/allowlist/index.test.ts: Tests disabled mode, admin bypass, empty SQL guard, trailing-semicolon normalization, AST structural mismatches, rejection audit logging, and DB error recovery.src/import/csv.test.ts: Tests empty body, unsupportedContent-Type, rawtext/csv, JSON-wrapped CSV withcolumnMapping,multipart/form-dataupload/missing-file handling, partial row failures, and malformed JSON.src/index.test.ts: Tests WorkerfetchCORS preflight, missing/invalid auth tokens, admin/client/WebSocket auth, JWKS JWT verification & missingsubguard, pre-auth &InterfacePluginrouting, and external DB/Hyperdrive configuration.src/operation.test.ts: CoversexecuteSDKQuery(PostgreSQL, MySQL, Cloudflare D1, Starbase, Turso, unsupported dialect), Hyperdrive paths,beforeQuery/afterQueryhooks, raw result transformations, and error recovery.src/do.test.ts: Covers Durable Object RPCinit(), alarms + failure recovery rescheduling, statistics, raw/parameterized queries, and WebSocket upgrade/message/broadcast/close flows.src/handler.test.ts: Covers missing external config guard, invalidContent-Type/params/transaction validation, andhandlePreAuthplugin route matching.src/rls/index.ts,src/rls/index.test.ts):node-sql-parsersubquery & CTE AST traversal (cte.stmt.ast/fromItem.expr.ast) and guarded subqueryfromTable.tablebeingundefinedinapplyRLSToAst.mockConfig.role = 'admin'mutation leak acrossdescribeblocks insrc/rls/index.test.tsand added tests for CTE,UNION, multi-statement, numeric policy values, and unauthorized action rejection.Verification
/claim #71
Closes #71