You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test('has toto',()=>{consttotoSymbol=Symbol.for('toto');Object.defineProperty(globalThis,totoSymbol,{enumerable: true,writable: true,value: 4,configurable: true,});expect(Object.getOwnPropertySymbols(globalThis).includes(totoSymbol)).toBe(true);// works with node 14, 16 and fails with node 18});
Expected behavior
The test should pass in both Node 14, Node 16 and Node 18. Actually I initially though the issue came from Node 18 itself but after manual trials, I found this reduced cases highlighted the issue and it passes in Node 18 without Jest and fails as soon as I add Jest.
Actual behavior
Fails on Node 18 (not expected). Passes on Node <18.
Additional context
I detected this issue while working on dubzzz/fast-check#3511. Actually everything went well until Node 18 and suddenly it broke. While investigating I got surprised by the fact that adding new properties to globalThis turns into nothing being added into getOwnPropertySymbols. So I digged a little bit more and arrived on this smaller case in which we can see that keys added to globalThis are not accessible in getOwnPropertySymbols starting at Node 18 with Jest while they are when running Node 18 alone or Node 16 with Jest.
The same test with Node test runner only passes in Node 18:
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
Version
29.3.1
Steps to reproduce
Expected behavior
The test should pass in both Node 14, Node 16 and Node 18. Actually I initially though the issue came from Node 18 itself but after manual trials, I found this reduced cases highlighted the issue and it passes in Node 18 without Jest and fails as soon as I add Jest.
Actual behavior
Fails on Node 18 (not expected). Passes on Node <18.
Additional context
I detected this issue while working on dubzzz/fast-check#3511. Actually everything went well until Node 18 and suddenly it broke. While investigating I got surprised by the fact that adding new properties to globalThis turns into nothing being added into getOwnPropertySymbols. So I digged a little bit more and arrived on this smaller case in which we can see that keys added to globalThis are not accessible in getOwnPropertySymbols starting at Node 18 with Jest while they are when running Node 18 alone or Node 16 with Jest.
The same test with Node test runner only passes in Node 18:
Environment
The text was updated successfully, but these errors were encountered: