Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cd78c5e

Browse filesBrowse files
MelinaMejia95targos
authored andcommitted
test: fixing broken test
test didn't throw the error, it was just returning it. So I removed the try/catch and assigned the error to a variable PR-URL: #28345 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent d88c697 commit cd78c5e
Copy full SHA for cd78c5e

File tree

Expand file treeCollapse file tree

1 file changed

+10
-12
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-12
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-readable-from.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-readable-from.js
+10-12Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const { Readable } = require('stream');
66
const { strictEqual } = require('assert');
77

88
async function toReadableBasicSupport() {
9-
async function * generate() {
9+
async function* generate() {
1010
yield 'a';
1111
yield 'b';
1212
yield 'c';
@@ -22,7 +22,7 @@ async function toReadableBasicSupport() {
2222
}
2323

2424
async function toReadableSyncIterator() {
25-
function * generate() {
25+
function* generate() {
2626
yield 'a';
2727
yield 'b';
2828
yield 'c';
@@ -64,7 +64,7 @@ async function toReadableString() {
6464
}
6565

6666
async function toReadableOnData() {
67-
async function * generate() {
67+
async function* generate() {
6868
yield 'a';
6969
yield 'b';
7070
yield 'c';
@@ -86,7 +86,7 @@ async function toReadableOnData() {
8686
}
8787

8888
async function toReadableOnDataNonObject() {
89-
async function * generate() {
89+
async function* generate() {
9090
yield 'a';
9191
yield 'b';
9292
yield 'c';
@@ -109,24 +109,22 @@ async function toReadableOnDataNonObject() {
109109
}
110110

111111
async function destroysTheStreamWhenThrowing() {
112-
async function * generate() {
112+
async function* generate() {
113113
throw new Error('kaboom');
114114
}
115115

116116
const stream = Readable.from(generate());
117117

118118
stream.read();
119119

120-
try {
121-
await once(stream, 'error');
122-
} catch (err) {
123-
strictEqual(err.message, 'kaboom');
124-
strictEqual(stream.destroyed, true);
125-
}
120+
const [err] = await once(stream, 'error');
121+
strictEqual(err.message, 'kaboom');
122+
strictEqual(stream.destroyed, true);
123+
126124
}
127125

128126
async function asTransformStream() {
129-
async function * generate(stream) {
127+
async function* generate(stream) {
130128
for await (const chunk of stream) {
131129
yield chunk.toUpperCase();
132130
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.