| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,21 +1,21 @@ | |||
| 1 | - // Flags: --expose-internals | ||
| 1 | + // Flags: --expose-internals --no-warnings | ||
| 2 | 2 | 'use strict'; | |
| 3 | 3 | ||
| 4 | - const common = require('../common'); | ||
| 4 | + const { hasCrypto } = require('../common'); | ||
| 5 | 5 | ||
| 6 | 6 | // This tests that the accessor properties do not raise assertions | |
| 7 | 7 | // when called with incompatible receivers. | |
| 8 | 8 | ||
| 9 | 9 | const assert = require('assert'); | |
| 10 | + const { test } = require('node:test'); | ||
| 10 | 11 | ||
| 11 | 12 | // Objects that call StreamBase::AddMethods, when setting up | |
| 12 | 13 | // their prototype | |
| 13 | 14 | const { internalBinding } = require('internal/test/binding'); | |
| 14 | - const TTY = internalBinding('tty_wrap').TTY; | ||
| 15 | - const UDP = internalBinding('udp_wrap').UDP; | ||
| 15 | + const { TTY } = internalBinding('tty_wrap'); | ||
| 16 | + const { UDP } = internalBinding('udp_wrap'); | ||
| 16 | 17 | ||
| 17 | - { | ||
| 18 | - // Should throw instead of raise assertions | ||
| 18 | + test('Should throw instead of raise assertions', () => { | ||
| 19 | 19 | assert.throws(() => { | |
| 20 | 20 | UDP.prototype.fd; // eslint-disable-line no-unused-expressions | |
| 21 | 21 | }, TypeError); | |
@@ -36,20 +36,20 @@ const UDP = internalBinding('udp_wrap').UDP; | |||
| 36 | 36 | 'typeof property descriptor ' + property + ' is not \'object\'' | |
| 37 | 37 | ); | |
| 38 | 38 | }); | |
| 39 | + }); | ||
| 39 | 40 | ||
| 40 | - if (common.hasCrypto) { // eslint-disable-line node-core/crypto-check | ||
| 41 | - // There are accessor properties in crypto too | ||
| 42 | - const crypto = internalBinding('crypto'); | ||
| 41 | + test('There are accessor properties in crypto too', { skip: !hasCrypto }, () => { | ||
| 42 | + // There are accessor properties in crypto too | ||
| 43 | + const crypto = internalBinding('crypto'); // eslint-disable-line node-core/crypto-check | ||
| 43 | 44 | ||
| 44 | - assert.throws(() => { | ||
| 45 | - // eslint-disable-next-line no-unused-expressions | ||
| 46 | - crypto.SecureContext.prototype._external; | ||
| 47 | - }, TypeError); | ||
| 45 | + assert.throws(() => { | ||
| 46 | + // eslint-disable-next-line no-unused-expressions | ||
| 47 | + crypto.SecureContext.prototype._external; | ||
| 48 | + }, TypeError); | ||
| 48 | 49 | ||
| 49 | - assert.strictEqual( | ||
| 50 | - typeof Object.getOwnPropertyDescriptor( | ||
| 51 | - crypto.SecureContext.prototype, '_external'), | ||
| 52 | - 'object' | ||
| 53 | - ); | ||
| 54 | - } | ||
| 55 | - } | ||
| 50 | + assert.strictEqual( | ||
| 51 | + typeof Object.getOwnPropertyDescriptor( | ||
| 52 | + crypto.SecureContext.prototype, '_external'), | ||
| 53 | + 'object' | ||
| 54 | + ); | ||
| 55 | + }); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,15 +1,18 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | require('../common'); | |
| 3 | + const { test } = require('node:test'); | ||
| 3 | 4 | ||
| 4 | 5 | // This test ensures Math functions don't fail with an "illegal instruction" | |
| 5 | 6 | // error on ARM devices (primarily on the Raspberry Pi 1) | |
| 6 | 7 | // See https://github.com/nodejs/node/issues/1376 | |
| 7 | 8 | // and https://code.google.com/p/v8/issues/detail?id=4019 | |
| 8 | 9 | ||
| 9 | 10 | // Iterate over all Math functions | |
| 10 | - Object.getOwnPropertyNames(Math).forEach((functionName) => { | ||
| 11 | - if (!/[A-Z]/.test(functionName)) { | ||
| 12 | - // The function names don't have capital letters. | ||
| 13 | - Math[functionName](-0.5); | ||
| 14 | - } | ||
| 11 | + test('Iterate over all Math functions', () => { | ||
| 12 | + Object.getOwnPropertyNames(Math).forEach((functionName) => { | ||
| 13 | + if (!/[A-Z]/.test(functionName)) { | ||
| 14 | + // The function names don't have capital letters. | ||
| 15 | + Math[functionName](-0.5); | ||
| 16 | + } | ||
| 17 | + }); | ||
| 15 | 18 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments