Skip to content

Commit

Permalink
fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
dygabo committed Jun 1, 2024
1 parent b02e556 commit c57ac5e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/parallel/test-global.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@ for (const moduleName of builtinModules) {
];
assert.deepStrictEqual(new Set(Object.keys(global)), new Set(expected));
expected.forEach((value) => {
if (typeof global[value] === 'function') {
assert.strictEqual(global[value].name, value);
const desc = Object.getOwnPropertyDescriptor(global, value);
if (typeof desc.value === 'function') {
assert.strictEqual(desc.value.name, value);
} else if (typeof desc.get === 'function') {
assert.strictEqual(desc.get.name, `get ${value}`);
}
});
}
Expand Down

0 comments on commit c57ac5e

Please sign in to comment.