diff --git a/test/parallel/test-accessor-properties.js b/test/parallel/test-accessor-properties.js index ae7919ea318..7b6c041a8d0 100644 --- a/test/parallel/test-accessor-properties.js +++ b/test/parallel/test-accessor-properties.js @@ -1,21 +1,21 @@ -// Flags: --expose-internals +// Flags: --expose-internals --no-warnings 'use strict'; -const common = require('../common'); +const { hasCrypto } = require('../common'); // This tests that the accessor properties do not raise assertions // when called with incompatible receivers. const assert = require('assert'); +const { test } = require('node:test'); // Objects that call StreamBase::AddMethods, when setting up // their prototype const { internalBinding } = require('internal/test/binding'); -const TTY = internalBinding('tty_wrap').TTY; -const UDP = internalBinding('udp_wrap').UDP; +const { TTY } = internalBinding('tty_wrap'); +const { UDP } = internalBinding('udp_wrap'); -{ - // Should throw instead of raise assertions +test('Should throw instead of raise assertions', () => { assert.throws(() => { UDP.prototype.fd; // eslint-disable-line no-unused-expressions }, TypeError); @@ -36,20 +36,20 @@ const UDP = internalBinding('udp_wrap').UDP; 'typeof property descriptor ' + property + ' is not \'object\'' ); }); +}); - if (common.hasCrypto) { // eslint-disable-line node-core/crypto-check - // There are accessor properties in crypto too - const crypto = internalBinding('crypto'); +test('There are accessor properties in crypto too', { skip: !hasCrypto }, () => { + // There are accessor properties in crypto too + const crypto = internalBinding('crypto'); // eslint-disable-line node-core/crypto-check - assert.throws(() => { - // eslint-disable-next-line no-unused-expressions - crypto.SecureContext.prototype._external; - }, TypeError); + assert.throws(() => { + // eslint-disable-next-line no-unused-expressions + crypto.SecureContext.prototype._external; + }, TypeError); - assert.strictEqual( - typeof Object.getOwnPropertyDescriptor( - crypto.SecureContext.prototype, '_external'), - 'object' - ); - } -} + assert.strictEqual( + typeof Object.getOwnPropertyDescriptor( + crypto.SecureContext.prototype, '_external'), + 'object' + ); +}); diff --git a/test/parallel/test-arm-math-illegal-instruction.js b/test/parallel/test-arm-math-illegal-instruction.js index 4bf881d1b38..c4a6ec01ba8 100644 --- a/test/parallel/test-arm-math-illegal-instruction.js +++ b/test/parallel/test-arm-math-illegal-instruction.js @@ -1,5 +1,6 @@ 'use strict'; require('../common'); +const { test } = require('node:test'); // This test ensures Math functions don't fail with an "illegal instruction" // error on ARM devices (primarily on the Raspberry Pi 1) @@ -7,9 +8,11 @@ require('../common'); // and https://code.google.com/p/v8/issues/detail?id=4019 // Iterate over all Math functions -Object.getOwnPropertyNames(Math).forEach((functionName) => { - if (!/[A-Z]/.test(functionName)) { - // The function names don't have capital letters. - Math[functionName](-0.5); - } +test('Iterate over all Math functions', () => { + Object.getOwnPropertyNames(Math).forEach((functionName) => { + if (!/[A-Z]/.test(functionName)) { + // The function names don't have capital letters. + Math[functionName](-0.5); + } + }); });