From 02ceda45aff2488f8a4dc35d1bfea4ee2fd3e903 Mon Sep 17 00:00:00 2001 From: Fred <98240+farnoux@users.noreply.github.com> Date: Mon, 20 Jan 2025 12:05:39 +0100 Subject: [PATCH] Change env var name for supabase key Corresponding to the name existing in `.env.example` --- Earthfile | 4 ++-- api_tests/lib/supabase.ts | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Earthfile b/Earthfile index 740ec40661..5429e74e52 100644 --- a/Earthfile +++ b/Earthfile @@ -609,7 +609,7 @@ api-test: --name api_test_tet \ --network $network \ --env SUPABASE_URL=$API_URL \ - --env SUPABASE_KEY=$SERVICE_ROLE_KEY \ + --env SUPABASE_ANON_KEY=$SERVICE_ROLE_KEY \ --env SUPABASE_SERVICE_ROLE_KEY=$SERVICE_ROLE_KEY \ api-test:latest test --no-check -A tests/$test/*.test.ts --location 'http://localhost' END @@ -625,7 +625,7 @@ api-crud-test: --name api_crud_test_tet \ --network $network \ --env SUPABASE_URL=$API_URL \ - --env SUPABASE_KEY=$ANON_KEY \ + --env SUPABASE_ANON_KEY=$ANON_KEY \ api-test:latest test -A tests/crud/crud.test.ts --location 'http://localhost' -- elements:axe cypress-wip: diff --git a/api_tests/lib/supabase.ts b/api_tests/lib/supabase.ts index 45cc64409d..76b053c8f8 100644 --- a/api_tests/lib/supabase.ts +++ b/api_tests/lib/supabase.ts @@ -1,20 +1,20 @@ -import "https://deno.land/x/dotenv/load.ts"; -import { createClient } from "https://esm.sh/@supabase/supabase-js@2.39.0"; -import { Database } from "./database.types.ts"; +import 'https://deno.land/x/dotenv/load.ts'; +import { createClient } from 'https://esm.sh/@supabase/supabase-js@2.39.0'; +import { Database } from './database.types.ts'; /** * Supabase client */ export const supabase = createClient( - Deno.env.get("SUPABASE_URL")!, - Deno.env.get("SUPABASE_KEY")!, + Deno.env.get('SUPABASE_URL')!, + Deno.env.get('SUPABASE_ANON_KEY')!, { db: { - schema: "public", + schema: 'public', }, auth: { // Pour fonctionner avec deno hors du navigateur. persistSession: false, }, - }, + } );