Skip to content

Commit a0577e1

Browse files
WcaleNieWolnyclaude
andcommitted
refactor: move supabase-js import to top level in apikeys tests
Move createClient import from dynamic imports inside test bodies to a static import at the top of the file for cleaner code. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 4661ea0 commit a0577e1

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

tests/apikeys.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { randomUUID } from 'node:crypto'
2+
import { createClient } from '@supabase/supabase-js'
23
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
34
import { BASE_URL, getSupabaseClient, headers, resetAndSeedAppData, resetAppData } from './test-utils.ts'
45

@@ -560,7 +561,6 @@ describe('[RLS] hashed API key with direct Supabase SDK', () => {
560561

561562
// Now use the hashed key directly with Supabase SDK (bypassing our API)
562563
// This simulates how the CLI uses the SDK with capgkey header
563-
const { createClient } = await import('@supabase/supabase-js')
564564
const supabaseWithHashedKey = createClient(
565565
process.env.SUPABASE_URL!,
566566
process.env.SUPABASE_ANON_KEY!,
@@ -610,7 +610,6 @@ describe('[RLS] hashed API key with direct Supabase SDK', () => {
610610
expect(createResponse.status).toBe(200)
611611

612612
// Use plain key with Supabase SDK
613-
const { createClient } = await import('@supabase/supabase-js')
614613
const supabaseWithPlainKey = createClient(
615614
process.env.SUPABASE_URL!,
616615
process.env.SUPABASE_ANON_KEY!,

0 commit comments

Comments
 (0)