The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Update unit-test.mdx
Rodrigo Mansueli Nunes026ec7e36d97
diff --git a/apps/docs/pages/guides/functions/unit-test.mdx b/apps/docs/pages/guides/functions/unit-test.mdxindex 9f6d26abcf8..9532e435858 100644--- a/apps/docs/pages/guides/functions/unit-test.mdx+++ b/apps/docs/pages/guides/functions/unit-test.mdx@@ -80,22 +80,18 @@ Deno.test('Hello-world Function Test', testHelloWorld)This test case consists of two parts. The first part tests the client library and verifies that the database can be connected to and returns values from a table (`my_table`). The second part tests the edge function and checks if the received value matches the expected value. Here's a brief overview of the code:-<Admonition type="note">- - We import various testing functions from the Deno standard library, including `assert`,- `assertExists`, and `assertEquals`. - We import the `createClient` and `SupabaseClient` classes- from the `@supabase/supabase-js` library to interact with the Supabase client. - We define the- necessary configuration for the Supabase client, including the Supabase URL, API key, and- authentication options. - The `testClientCreation` function tests the creation of a Supabase- client instance and queries the database for data from a table. It verifies that data is returned- from the query. - The `testHelloWorld` function tests the "Hello-world" Edge Function by invoking- it using the Supabase client's `functions.invoke` method. It checks if the response message- matches the expected greeting. - We run the tests using the `deno test` function, providing a- descriptive name for each test case and the corresponding test function.-</Admonition>+- We import various testing functions from the Deno standard library, including `assert`, `assertExists`, and `assertEquals`.+- We import the `createClient` and `SupabaseClient` classes from the `@supabase/supabase-js` library to interact with the Supabase client.+- We define the necessary configuration for the Supabase client, including the Supabase URL, API key, and authentication options.+- The `testClientCreation` function tests the creation of a Supabase client instance and queries the database for data from a table. It verifies that data is returned from the query.+- The `testHelloWorld` function tests the "Hello-world" Edge Function by invoking it using the Supabase client's `functions.invoke` method. It checks if the response message matches the expected greeting.+- We run the tests using the `Deno.test` function, providing a descriptive name for each test case and the corresponding test function.<Admonition type="important">- Please make sure to replace the placeholders (`supabaseUrl`, `supabaseKey`, `my_table`) with the- actual values relevant to your Supabase setup.++Please make sure to replace the placeholders (`supabaseUrl`, `supabaseKey`, `my_table`) with the+actual values relevant to your Supabase setup.+</Admonition>### Running Edge Functions Locally