mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Use react@17 for useSyncExternalStore shim tests (#28055)
The tests for the shim need to test with ReactDOM.render in React 17.
This commit is contained in:
@@ -170,9 +170,14 @@ if (process.env.REACT_CLASS_EQUIVALENCE_TEST) {
|
||||
return message;
|
||||
}
|
||||
const re = /react.dev\/errors\/(\d+)?\??([^\s]*)/;
|
||||
const matches = message.match(re);
|
||||
let matches = message.match(re);
|
||||
if (!matches || matches.length !== 3) {
|
||||
return message;
|
||||
// Some tests use React 17, when the URL was different.
|
||||
const re17 = /error-decoder.html\?invariant=(\d+)([^\s]*)/;
|
||||
matches = message.match(re17);
|
||||
if (!matches || matches.length !== 3) {
|
||||
return message;
|
||||
}
|
||||
}
|
||||
const code = parseInt(matches[1], 10);
|
||||
const args = matches[2]
|
||||
|
||||
Reference in New Issue
Block a user