Skip to content

Commit

Permalink
test: Ensure types are from stream/web
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiralite committed Feb 2, 2025
1 parent 7359a82 commit 003e3e5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/types/websocket.test-d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { ReadableStream, WritableStream } from 'stream/web'
import { expectType } from 'tsd'
import { WebSocketStream } from '../../types'

declare const webSocketStream: WebSocketStream
const webSocketStreamOpened = await webSocketStream.opened

// Test that the readable and writable streams are of identical types to ones from stream/web
expectType<WritableStream>(webSocketStreamOpened.writable)
expectType<ReadableStream>(webSocketStreamOpened.readable)

0 comments on commit 003e3e5

Please sign in to comment.