test: refactor test-accessor-properties

PR-URL: https://github.com/nodejs/node/pull/29943
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
himself65 authored and Michaël Zasso committed 2019-12-10 10:09:41 +01:00
1 parent 60886036c9
commit 5ae3a858f7
1 file changed
+5 -12
+5 -12
View File
@@ -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);
@@ -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),