Skip to content

fix(rls): resolve policy table matching and bring test coverage above 75% across all metrics - #296

Open
Frankenstein14 wants to merge 1 commit into
outerbase:mainfrom
Frankenstein14:feat/vitest-coverage-75-and-rls-fix
Open

Frankenstein14 wants to merge 1 commit into
outerbase:mainfrom
Frankenstein14:feat/vitest-coverage-75-and-rls-fix

Conversation

@Frankenstein14

Copy link
Copy Markdown

Purpose

Resolves #71: fixes the 4 failing RLS tests and brings Vitest test coverage across all metrics (lines, statements, branches, and functions) above 75%.

Tasks

  • Fix RLS policy table matching for schema-qualified tables and JOIN aliases in src/rls/index.ts
  • Repair failing RLS test suite in src/rls/index.test.ts
  • Add unit test suite for allowlist module in src/allowlist/index.test.ts
  • Add unit test suite for CSV import in src/import/csv.test.ts
  • Add unit test suite for worker fetch handler in src/index.test.ts
  • Expand branch coverage in src/operation.test.ts, src/handler.test.ts, and src/do.test.ts

Verify

Run tests with coverage:
�ash pnpm vitest run --coverage.enabled true --coverage.reportOnFailure

All 245 tests pass and all metrics exceed the 75% threshold:

  • Statements: 94.13% (threshold: 75%)
  • Branches: 79.60% (threshold: 75%)
  • Functions: 93.98% (threshold: 75%)
  • Lines: 94.49% (threshold: 75%)

/claim #71

… 75% across all metrics

- Fix schema-qualified policy table matching in src/rls/index.ts
- Repair existing RLS test suite in src/rls/index.test.ts
- Add comprehensive test suites for src/allowlist, src/import/csv, and src/index
- Expand branch coverage in src/operation.test.ts, src/handler.test.ts, and src/do.test.ts
- Exceed Vitest coverage thresholds: Stmts 94.13%, Branch 79.60%, Funcs 93.98%, Lines 94.49%

Fixes outerbase#71
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.

Improve test coverage with Vitest

1 participant