Skip to content

test: replace impl-detail assertions with behavioral ones#267

Merged
onmax merged 2 commits intomainfrom
test/behavioral-assertions
Mar 19, 2026
Merged

test: replace impl-detail assertions with behavioral ones#267
onmax merged 2 commits intomainfrom
test/behavioral-assertions

Conversation

@onmax
Copy link
Collaborator

@onmax onmax commented Mar 17, 2026

Summary

  • Removed redundant mock-call assertions (toHaveBeenCalledWith, toHaveBeenCalledOnce, toHaveBeenCalledTimes) where state/output assertions already prove behavior
  • Replaced vi.mock('h3') with real createError in session tests
  • Strengthened memoization tests: toEqualtoBe (reference equality proves caching without mock call counts)
  • Replaced toHaveBeenCalledBefore with behavioral assertion (capture session state inside onSuccess callback)
  • Replaced mockClient.useSession.toHaveBeenCalledOnce() with auth.client/auth.ready state checks

Test plan

  • All 231 tests pass

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 17, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@onmax/nuxt-better-auth@267

commit: dba0446

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 17, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
better-auth dba0446 Mar 19 2026, 06:18 AM

@onmax onmax force-pushed the test/behavioral-assertions branch from e0d1b31 to b1c901c Compare March 17, 2026 09:56
@onmax onmax merged commit 914cd86 into main Mar 19, 2026
3 of 4 checks passed
@onmax onmax deleted the test/behavioral-assertions branch March 19, 2026 06:36
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