Skip to content

test: improve test coverage with Vitest for allowlist and LiteREST - #310

Closed
isearchxsolve wants to merge 1 commit into
outerbase:mainfrom
isearchxsolve:fix/test-coverage-vitest
Closed

isearchxsolve wants to merge 1 commit into
outerbase:mainfrom
isearchxsolve:fix/test-coverage-vitest

Conversation

@isearchxsolve

Copy link
Copy Markdown

/claim #71

Summary of Changes

This Pull Request resolves #71 by introducing comprehensive test coverage using Vitest for critical database subsystems and edge cases:

  1. AST Allowlist Verification (src/allowlist/index.test.ts):
  • Tests isQueryAllowed with isEnabled: false bypass.
  • Tests admin role token bypass.
  • Tests AST parsing normalization and positive match against allowlist table.
  • Tests query rejection and audit insertion into mp_allowlist_rejections.
  • Tests input validation on empty query strings.
  1. LiteREST Boundary & Edge-Case Coverage (src/literest/index.test.ts):
  • Handles queries targeting non-existent tables gracefully with error response.
  • Safely verifies negative primary key lookups (-1).
  • Ignores null filter parameters without failing query construction.

All tests follow repository Vitest conventions without altering production behavior.

@isearchxsolve

Copy link
Copy Markdown
Author

Closing in deference to existing earlier open pull requests for #71. Thank you!

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