-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: move a couple of tests over to using node:test
PR-URL: #54582 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
- Loading branch information
Showing
2 changed files
with
28 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
'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) | ||
// See https://github.com/nodejs/node/issues/1376 | ||
// 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); | ||
} | ||
}); | ||
}); |