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 d4bb88e

Browse filesBrowse files
himself65BridgeAR
authored andcommitted
test: simplify tests code
PR-URL: #28065 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent f897860 commit d4bb88e
Copy full SHA for d4bb88e

File tree

Expand file treeCollapse file tree

1 file changed

+9
-20
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-20
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-accessor-properties.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-accessor-properties.js
+9-20Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,27 +33,16 @@ const UDP = internalBinding('udp_wrap').UDP;
3333
}, TypeError);
3434

3535
const StreamWrapProto = Object.getPrototypeOf(TTY.prototype);
36+
const properties = ['bytesRead', 'fd', '_externalStream'];
3637

37-
// Should not throw for Object.getOwnPropertyDescriptor
38-
assert.strictEqual(
39-
typeof Object.getOwnPropertyDescriptor(StreamWrapProto, 'bytesRead'),
40-
'object'
41-
);
42-
43-
assert.strictEqual(
44-
typeof Object.getOwnPropertyDescriptor(StreamWrapProto, 'fd'),
45-
'object'
46-
);
47-
48-
assert.strictEqual(
49-
typeof Object.getOwnPropertyDescriptor(StreamWrapProto, '_externalStream'),
50-
'object'
51-
);
52-
53-
assert.strictEqual(
54-
typeof Object.getOwnPropertyDescriptor(StreamWrapProto, 'fd'),
55-
'object'
56-
);
38+
properties.forEach((property) => {
39+
// Should not throw for Object.getOwnPropertyDescriptor
40+
assert.strictEqual(
41+
typeof Object.getOwnPropertyDescriptor(StreamWrapProto, property),
42+
'object',
43+
'typeof property descriptor ' + property + ' is not \'object\''
44+
);
45+
});
5746

5847
if (common.hasCrypto) { // eslint-disable-line node-core/crypto-check
5948
// There are accessor properties in crypto too

0 commit comments

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