Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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, `TypeError on: TTY.prototype.${property}`);

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