Skip to content

test(sql-macros): add Vitest unit tests for sql-macros plugin (fixes #71) - #326

Open
GabrielHFGoncalez wants to merge 1 commit into
outerbase:mainfrom
GabrielHFGoncalez:feature/sql-macros-unit-tests
Open

GabrielHFGoncalez wants to merge 1 commit into
outerbase:mainfrom
GabrielHFGoncalez:feature/sql-macros-unit-tests

Conversation

@GabrielHFGoncalez

Copy link
Copy Markdown

🧪 Vitest Unit Test Suite for plugins/sql-macros

Contributes to #71 by providing unit test coverage for the plugins/sql-macros plugin.

📦 Test Coverage

  • Initialization: Verifies plugin identification (starbasedb:sql-macros) and preventSelectStar configuration.
  • Data Source Guards: Tests that beforeQuery safely passes through SQL and parameters unmodified when dataSource is absent.
  • SQL Wildcard Verification: Validates queries targeting explicit column names proceed smoothly.
  • Role-Based Admin Bypass: Verifies that users with the admin role are permitted to run SELECT * statements unimpeded.

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.

1 participant