© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago
abdulrahim

Mock data from client with jest (supabase.js)

How can I mock the data returned from client.from method in supabse javascript client libarary ?

This should work, but how can mock the {data} of returned PostgrestQueryBuilder ?
 mockSupabaseClient.from.mockImplementationOnce(("profiles") => {
   return new PostgrestQueryBuilder(url,{})      })
 mockSupabaseClient.from.mockImplementationOnce(("profiles") => {
   return new PostgrestQueryBuilder(url,{})      })
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Scrapping Data from Website with Supabase
SupabaseSSupabase / help-and-questions
8mo ago
Question about supabase-js client capabilities
SupabaseSSupabase / help-and-questions
6mo ago
Can we run an sql query from js supabase client ?
SupabaseSSupabase / help-and-questions
3y ago
auth with js client
SupabaseSSupabase / help-and-questions
4y ago