Skip to content

Commit

Permalink
Merge pull request #44
Browse files Browse the repository at this point in the history
Bump typescript from 5.3.3 to 5.5.2
  • Loading branch information
larabr authored Jun 25, 2024
2 parents 5679d96 + 8327273 commit 0d1629b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
28 changes: 14 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
"ts-mocha": "^10.0.0",
"ts-node": "^10.9.2",
"tsx": "^4.7.0",
"typescript": "^5.0.4",
"web-streams-polyfill": "^3.3.2"
"typescript": "^5.5.2",
"web-streams-polyfill": "^4.0.0"
},
"peerDependencies": {
"typescript": ">=4.2"
Expand Down
6 changes: 3 additions & 3 deletions test/node.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ describe('Node integration tests', () => {
it('polyfilled web stream cannot be converted into node native stream', async () => {
const { ReadableStream: PolyfilledReadableStream } = await import ('web-streams-polyfill');

// this test is just to keep track that this behaviour is expected
// this test is just to keep track that this behaviour is expected: it does not cause a TS error, but a runtime one
const input = 'chunk';
const stream = new PolyfilledReadableStream({
const stream: NodeWebReadableStream<string> = new PolyfilledReadableStream<string>({
start(controller) {
controller.enqueue(input);
controller.close();
}
});
const streamedData = toStream(stream);
// @ts-expect-error `fromWeb` does not accept the polyfilled stream
// `fromWeb` does not accept the polyfilled stream
expect(() => NodeNativeReadableStream.fromWeb(streamedData)).to.throw(/must be an instance of ReadableStream/);
});
});
4 changes: 2 additions & 2 deletions test/typescript.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ const newEmptyWebStream = <T extends Data>(): WebStream<T> => new WebReadableStr
const expectedWebStreamButActualNodeStream: WebStream<string> = toStream(nodeWebStream);
assert(expectedWebStreamButActualNodeStream instanceof NodeWebReadableStream);
const newStringStream: Stream<string> = toStream('chunk');
assert(newStringStream instanceof WebReadableStream); // ReadableStream is polyfilled
assert(newStringStream instanceof NodeWebReadableStream);
// @ts-expect-error detect type parameter mismatch
const anotherStringStream: Stream<Uint8Array> = toStream('chunk');
assert(anotherStringStream instanceof WebReadableStream); // ReadableStream is polyfilled
assert(anotherStringStream instanceof NodeWebReadableStream);

assert(isArrayStream(new ArrayStream())) ; // ensure Array is actually extended in e.g. es5

Expand Down

0 comments on commit 0d1629b

Please sign in to comment.