Skip to content

Commit

Permalink
test: refactor test-accessor-properties
Browse files Browse the repository at this point in the history
PR-URL: #29943
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
  • Loading branch information
himself65 authored and targos committed Dec 10, 2019
1 parent 6088603 commit 5ae3a85
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions test/parallel/test-accessor-properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,6 @@ const UDP = internalBinding('udp_wrap').UDP;

{
// Should throw instead of raise assertions
assert.throws(() => {
TTY.prototype.bytesRead;
}, TypeError);

assert.throws(() => {
TTY.prototype.fd;
}, TypeError);

assert.throws(() => {
TTY.prototype._externalStream;
}, TypeError);

assert.throws(() => {
UDP.prototype.fd;
}, TypeError);
Expand All @@ -36,6 +24,11 @@ const UDP = internalBinding('udp_wrap').UDP;
const properties = ['bytesRead', 'fd', '_externalStream'];

properties.forEach((property) => {
// Should throw instead of raise assertions
assert.throws(() => {
TTY.prototype[property];
}, TypeError, `Missing expected TypeError for TTY.prototype.${property}`);

// Should not throw for Object.getOwnPropertyDescriptor
assert.strictEqual(
typeof Object.getOwnPropertyDescriptor(StreamWrapProto, property),
Expand Down

0 comments on commit 5ae3a85

Please sign in to comment.