Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,6 @@ docs/v2
test/*/package-lock.json
test/integration/*/package-lock.json

.cursor/
.cursor/

deno.lock
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@supabase/functions-js": "2.4.5",
"@supabase/node-fetch": "2.6.15",
"@supabase/postgrest-js": "1.19.4",
"@supabase/realtime-js": "2.15.0",
"@supabase/realtime-js": "2.15.1",
"@supabase/storage-js": "^2.10.4"
},
"devDependencies": {
Expand Down
21 changes: 19 additions & 2 deletions test/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,22 @@ const SUPABASE_URL = 'http://127.0.0.1:54321'
const ANON_KEY =
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0'

// For Node.js < 22, we need to provide a WebSocket implementation
// Node.js 22+ has native WebSocket support
let wsTransport: any = undefined
if (typeof WebSocket === 'undefined' && typeof process !== 'undefined' && process.versions?.node) {
try {
wsTransport = require('ws')
} catch (error) {
console.warn('WebSocket not available, Realtime features may not work')
}
}

const supabase = createClient(SUPABASE_URL, ANON_KEY, {
realtime: { heartbeatIntervalMs: 500 },
realtime: {
heartbeatIntervalMs: 500,
...(wsTransport && { transport: wsTransport }),
},
})

describe('Supabase Integration Tests', () => {
Expand Down Expand Up @@ -315,7 +329,10 @@ describe('Storage API', () => {
// use service_role key for bypass RLS
const SERVICE_ROLE_KEY = process.env.SUPABASE_SERVICE_ROLE_KEY || 'use-service-role-key'
const supabaseWithServiceRole = createClient(SUPABASE_URL, SERVICE_ROLE_KEY, {
realtime: { heartbeatIntervalMs: 500 },
realtime: {
heartbeatIntervalMs: 500,
...(wsTransport && { transport: wsTransport }),
},
})

test('upload and list file in bucket', async () => {
Expand Down
Loading