Skip to content

Commit 1721e73

Browse files
authored
[test] Fix Error Proxy in Node.js 21+ (#35227)
1 parent 6875c3e commit 1721e73

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

scripts/jest/setupTests.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,13 @@ if (process.env.REACT_CLASS_EQUIVALENCE_TEST) {
136136
}
137137
return Reflect.set(target, key, value, receiver);
138138
},
139+
get(target, key, receiver) {
140+
if (key === 'stack') {
141+
// https://github.com/nodejs/node/issues/60862
142+
return Reflect.get(target, key);
143+
}
144+
return Reflect.get(target, key, receiver);
145+
},
139146
});
140147
originalErrorInstances.set(proxy, error);
141148
return proxy;

0 commit comments

Comments
 (0)