Skip to content

Commit b222c58

Browse files
committed
removeChannel part of the fist test and added random uuid to another test
1 parent e99dc63 commit b222c58

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/pubsub.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ describe('pubSub', () => {
99
const connection = getChinookDatabase()
1010
const pubSub = await connection.getPubSub()
1111

12-
const channelName = 'test-channel-' + self.crypto.randomUUID()
1312
try {
13+
const channelName = 'test-channel-' + crypto.randomUUID()
1414
let callbackCalled = false
1515
const message = 'Message in a bottle ' + Math.floor(Math.random() * 999)
1616

@@ -38,8 +38,8 @@ describe('pubSub', () => {
3838
}
3939

4040
expect(callbackCalled).toBeTruthy()
41-
} finally {
4241
pubSub.removeChannel(channelName)
42+
} finally {
4343
connection.close()
4444
pubSub.close()
4545
}
@@ -108,7 +108,7 @@ describe('pubSub', () => {
108108
const pubSub = await connection.getPubSub()
109109

110110
try {
111-
const channelName = 'test-channel-' + Math.floor(Math.random() * 999)
111+
const channelName = 'test-channel-' + crypto.randomUUID()
112112

113113
await pubSub.createChannel(channelName)
114114

0 commit comments

Comments
 (0)