File tree Expand file tree Collapse file tree 1 file changed +9
-20
lines changed
Expand file tree Collapse file tree 1 file changed +9
-20
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments