[PR #9104] test(prisma-adapter): add coverage for empty where condition #16684

Open
opened 2026-04-13 10:38:39 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/9104
Author: @MuzzaiyyanHussain
Created: 4/10/2026
Status: 🔄 Open

Base: mainHead: test/prisma-empty-where


📝 Commits (1)

  • 545bec7 test(prisma-adapter): add coverage for empty where condition

📊 Changes

1 file changed (+19 additions, -0 deletions)

View changed files

📝 packages/prisma-adapter/src/prisma-adapter.test.ts (+19 -0)

📄 Description

Summary

Adds test coverage for edge cases in the Prisma adapter update method.

Changes

  • Added a test to verify behavior when where condition is empty
  • Ensured the adapter returns null instead of throwing an error

Why

The current behavior for an empty where condition was not explicitly tested.
This PR ensures the behavior is documented and prevents accidental regressions in the future.

Notes

  • No changes to existing logic
  • Only test coverage improvements

Summary by cubic

Add a unit test ensuring prisma-adapter’s update returns null when where is empty. Documents expected behavior and guards against regressions.

Written for commit 545bec742f. Summary will update on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/9104 **Author:** [@MuzzaiyyanHussain](https://github.com/MuzzaiyyanHussain) **Created:** 4/10/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `test/prisma-empty-where` --- ### 📝 Commits (1) - [`545bec7`](https://github.com/better-auth/better-auth/commit/545bec742f81343dbf515908abed31eb7db94517) test(prisma-adapter): add coverage for empty where condition ### 📊 Changes **1 file changed** (+19 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/prisma-adapter/src/prisma-adapter.test.ts` (+19 -0) </details> ### 📄 Description ## Summary Adds test coverage for edge cases in the Prisma adapter `update` method. ## Changes - Added a test to verify behavior when `where` condition is empty - Ensured the adapter returns `null` instead of throwing an error ## Why The current behavior for an empty `where` condition was not explicitly tested. This PR ensures the behavior is documented and prevents accidental regressions in the future. ## Notes - No changes to existing logic - Only test coverage improvements <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Add a unit test ensuring `prisma-adapter`’s `update` returns null when `where` is empty. Documents expected behavior and guards against regressions. <sup>Written for commit 545bec742f81343dbf515908abed31eb7db94517. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 10:38:39 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#16684