mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
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:
1 parent
60886036c9
commit
5ae3a858f7
1 file changed
+5
-12
@@ -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),
|
||||
|
||||
Reference in new issue
Block a user