Skip to content

test: add coverage for sql-storage.ts type-guard branches - #30167

Open
EmaToplek wants to merge 1 commit into
prisma:mainfrom
EmaToplek:test/contract-sql-storage-coverage
Open

test: add coverage for sql-storage.ts type-guard branches#30167
EmaToplek wants to merge 1 commit into
prisma:mainfrom
EmaToplek:test/contract-sql-storage-coverage

Conversation

@EmaToplek

@EmaToplek EmaToplek commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds test coverage for isSqlAuthoringContributions and isMaterializedSqlNamespace type guards in packages/2-sql/1-core/contract/src/ir/sql-storage.ts.

  • sql-storage.ts: 100% statements/functions/lines, 94.73% branches (up from 70%/47%/60%/74%)

Related to the M9 target-extensible-IR coverage gap noted in coverage.config.json (TML-2521).

Summary by CodeRabbit

  • Tests
    • Added coverage for validating SQL authoring contribution objects.
    • Added coverage for validating materialized SQL namespace objects.
    • Expanded edge-case testing for missing, invalid, null, primitive, and valid inputs.

Signed-off-by: EmaToplek <toplek.ema0213@outlook.com>
@EmaToplek
EmaToplek requested a review from a team as a code owner August 28, 2026 21:15
@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: 6c9d6392-944e-482a-942d-7a5c32f7b96a

📥 Commits

Reviewing files that changed from the base of the PR and between ca8fe14 and 98448d9.

📒 Files selected for processing (1)
  • packages/2-sql/1-core/contract/test/sql-storage.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The SQL storage contract tests now cover isSqlAuthoringContributions and isMaterializedSqlNamespace with valid and invalid inputs.

Changes

SQL storage contracts

Layer / File(s) Summary
Type-guard coverage
packages/2-sql/1-core/contract/test/sql-storage.test.ts
The test file imports both type guards. Tests cover missing and invalid properties, primitive inputs, and valid function properties.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 98448

This PR only adds coverage for SQL storage type guards and does not change production behavior; no actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: wmadden-electric

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding test coverage for type-guard branches in sql-storage.ts.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

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