Skip to content

Commit be97f71

Browse files
himself65targos
authored andcommitted
test: refactor test-accessor-properties
PR-URL: #29943 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 1743738 commit be97f71

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

test/parallel/test-accessor-properties.js

+5-12
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,6 @@ const UDP = internalBinding('udp_wrap').UDP;
1616

1717
{
1818
// Should throw instead of raise assertions
19-
assert.throws(() => {
20-
TTY.prototype.bytesRead;
21-
}, TypeError);
22-
23-
assert.throws(() => {
24-
TTY.prototype.fd;
25-
}, TypeError);
26-
27-
assert.throws(() => {
28-
TTY.prototype._externalStream;
29-
}, TypeError);
30-
3119
assert.throws(() => {
3220
UDP.prototype.fd;
3321
}, TypeError);
@@ -36,6 +24,11 @@ const UDP = internalBinding('udp_wrap').UDP;
3624
const properties = ['bytesRead', 'fd', '_externalStream'];
3725

3826
properties.forEach((property) => {
27+
// Should throw instead of raise assertions
28+
assert.throws(() => {
29+
TTY.prototype[property];
30+
}, TypeError, `Missing expected TypeError for TTY.prototype.${property}`);
31+
3932
// Should not throw for Object.getOwnPropertyDescriptor
4033
assert.strictEqual(
4134
typeof Object.getOwnPropertyDescriptor(StreamWrapProto, property),

0 commit comments

Comments
 (0)