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 <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
himself65 authored and BethGriggs committed Feb 6, 2020
1 parent e00c4e4 commit 0dae8fe
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions test/parallel/test-accessor-properties.js
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 0dae8fe

Please sign in to comment.