Skip to content

Commit ecd828e

Browse files
committed
test: Ensure types are from stream/web
1 parent dfaf55d commit ecd828e

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

test/types/websocket.test-d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { ReadableStream, WritableStream } from 'stream/web'
2+
import { expectType } from 'tsd'
3+
import { WebSocketStream } from '../../types'
4+
5+
declare const webSocketStream: WebSocketStream
6+
const webSocketStreamOpened = await webSocketStream.opened
7+
8+
// Test that the readable and writable streams are of identical types to ones from stream/web
9+
expectType<WritableStream>(webSocketStreamOpened.writable)
10+
expectType<ReadableStream>(webSocketStreamOpened.readable)

0 commit comments

Comments
 (0)