Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

add Admonition

Rodrigo Mansueli Nunes5e3dbced81a4
diff --git a/apps/docs/pages/guides/functions/unit-test.mdx b/apps/docs/pages/guides/functions/unit-test.mdx
index e12fe8358cd..1228a20f65a 100644
--- a/apps/docs/pages/guides/functions/unit-test.mdx
+++ b/apps/docs/pages/guides/functions/unit-test.mdx
@@ -80,14 +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.
+- We run the tests using the `deno test` function, providing a descriptive name for each test case and the corresponding test function.
+</Admonition>
-Note: Please make sure to replace the placeholders (`supabaseUrl`, `supabaseKey`, `my_table`) with the actual values relevant to your Supabase setup.
+<Admonition type="important">
+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