Skip to content

Commit 1343f18

Browse files
committed
feat(repo): remove remaining references to node-fetch
1 parent 1f5bf48 commit 1343f18

File tree

3 files changed

+3
-27
lines changed

3 files changed

+3
-27
lines changed

packages/core/realtime-js/test/RealtimeClient.test.ts

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -136,38 +136,16 @@ describe('Additional Coverage Tests', () => {
136136
params: { apikey: '123456789' },
137137
})
138138

139-
// Access the _resolveFetch method to test Node.js fallback
139+
// Access the _resolveFetch method to test native fetch usage
140140
const fetchFn = socket._resolveFetch()
141141

142-
// Test that it returns a function that would import node-fetch
142+
// Test that it returns a function (should use native fetch)
143143
expect(typeof fetchFn).toBe('function')
144144

145145
// Restore fetch
146146
global.fetch = originalFetch
147147
})
148148

149-
test('should handle node-fetch import failure', async () => {
150-
// Mock environment without fetch
151-
const originalFetch = global.fetch
152-
// @ts-ignore
153-
delete global.fetch
154-
155-
const socket = new RealtimeClient(testSetup.url, {
156-
params: { apikey: '123456789' },
157-
})
158-
159-
const fetchFn = socket._resolveFetch()
160-
161-
// Try to call the fetch function (it should attempt to import node-fetch and fail)
162-
try {
163-
await fetchFn('http://example.com')
164-
} catch (error) {
165-
expect(error.message).toContain('Failed to load @supabase/node-fetch')
166-
}
167-
168-
// Restore fetch
169-
global.fetch = originalFetch
170-
})
171149
})
172150

173151
describe('_leaveOpenTopic', () => {

packages/core/supabase-js/test/deno/setup-deps.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ const versions = {
2626
postgrest: getVersion('@supabase/postgrest-js'),
2727
auth: getVersion('@supabase/auth-js'),
2828
storage: getVersion('@supabase/storage-js'),
29-
node_fetch: getVersion('@supabase/node-fetch'),
3029
}
3130

3231
// Read or create deno.json
@@ -54,7 +53,6 @@ denoJson.imports = {
5453
process.env.STORAGE_JS_ENTRY === 'main'
5554
? `npm:@supabase/storage-js@${versions.storage}/dist/main/index.js`
5655
: `npm:@supabase/storage-js@${versions.storage}/dist/module/index.js`,
57-
'@supabase/node-fetch': `npm:@supabase/node-fetch@${versions.node_fetch}`,
5856
}
5957

6058
// Ensure Node types are available for Deno type-checking of .d.ts files

packages/core/supabase-js/test/unit/fetch.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe('fetch module', () => {
3333
expect(globalFetch).toHaveBeenCalledWith('test')
3434
})
3535

36-
test('should fallback to node-fetch when global fetch is undefined', () => {
36+
test('should return native fetch when no custom fetch provided', () => {
3737
const result = resolveFetch()
3838
expect(typeof result).toBe('function')
3939
})

0 commit comments

Comments
 (0)