Skip to content

Commit 36b4e93

Browse files
committed
add type test for client.connect
1 parent f145d71 commit 36b4e93

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/types/client.test-d.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,4 +319,15 @@ expectAssignable<Client>(
319319
expectType<number>(client.stats.pending)
320320
expectType<number>(client.stats.running)
321321
expectType<number>(client.stats.size)
322+
323+
// opaque
324+
expectType<Promise<Dispatcher.ConnectData<number>>>(
325+
client.connect({ opaque: 123, path: '' })
326+
)
327+
expectType<Promise<Dispatcher.ConnectData<null>>>(
328+
client.connect({ path: '' })
329+
)
330+
expectType<Promise<Dispatcher.ConnectData<{ foo: string }>>>(
331+
client.connect({ opaque: { foo: 'bar' }, path: '' })
332+
)
322333
}

0 commit comments

Comments
 (0)