Skip to content

Commit e73383f

Browse files
committed
remove integration tests for now
1 parent 16aaa21 commit e73383f

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,16 @@ jobs:
3535
uses: actions/setup-node@v4
3636
with:
3737
node-version: ${{ matrix.node }}
38+
3839
- name: Set up Supabase CLI
3940
uses: supabase/setup-cli@v1
4041
with:
4142
version: latest
4243

43-
- name: Start Supabase
44-
run: supabase start
4544
- name: Run tests
4645
run: |
4746
npm clean-install
4847
npm run test:coverage
49-
- name: Run integration tests
50-
timeout-minutes: 2
51-
run: npm run test:integration
5248
5349
- name: Upload coverage results to Coveralls
5450
uses: coverallsapp/github-action@master

test/integration.test.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,27 +103,33 @@ describe('Supabase Integration Tests', () => {
103103
const testMessage = { message: 'test' }
104104
let receivedMessage: any
105105
let subscribed = false
106+
let attempts = 0
106107

107108
channel
108109
.on('broadcast', { event: '*' }, (payload) => (receivedMessage = payload))
109-
.subscribe((status, error) => {
110+
.subscribe((status) => {
110111
if (status == 'SUBSCRIBED') subscribed = true
111-
console.log('Channel status:', { status, error })
112112
})
113113

114114
// Wait for subscription
115115
while (!subscribed) {
116+
if (attempts > 50) throw new Error('Timeout waiting for subscription')
116117
await new Promise((resolve) => setTimeout(resolve, 100))
118+
attempts++
117119
}
118120

121+
attempts = 0
122+
119123
channel.send({ type: 'broadcast', event: 'test-event', payload: testMessage })
120124

121125
// Wait on message
122126
while (!receivedMessage) {
127+
if (attempts > 50) throw new Error('Timeout waiting for message')
123128
await new Promise((resolve) => setTimeout(resolve, 100))
129+
attempts++
124130
}
125131
expect(receivedMessage).toBeDefined()
126132
expect(supabase.realtime.channels.size).toBe(1)
127-
}, 15000)
133+
}, 10000)
128134
})
129135
})

0 commit comments

Comments
 (0)