mirror of
https://github.com/facebook/react.git
synced 2026-02-23 20:23:02 +00:00
DevTools test shell tweaks (#17054)
* Updated DevTools shell ignore warning message to account for recent changes in warning text * Update DevTools console patching to patch the parent window's console rather than the iframe, to more accurately simulate real usage environment
This commit is contained in:
@@ -11,7 +11,12 @@ function ignoreStrings(
|
||||
methodName: string,
|
||||
stringsToIgnore: Array<string>,
|
||||
): void {
|
||||
const originalMethod = console[methodName];
|
||||
// HACKY In the test harness, DevTools overrides the parent window's console.
|
||||
// Our test app code uses the iframe's console though.
|
||||
// To simulate a more accurate end-ot-end ienvironment,
|
||||
// the shell's console patching should pass through to the parent override methods.
|
||||
const originalMethod = window.parent.console[methodName];
|
||||
|
||||
console[methodName] = (...args) => {
|
||||
const maybeString = args[0];
|
||||
if (typeof maybeString === 'string') {
|
||||
|
||||
@@ -31,7 +31,7 @@ ignoreErrors([
|
||||
'Warning: Unsafe lifecycle methods',
|
||||
'Warning: %s is deprecated in StrictMode.', // findDOMNode
|
||||
]);
|
||||
ignoreWarnings(['Warning: componentWillReceiveProps is deprecated']);
|
||||
ignoreWarnings(['Warning: componentWillReceiveProps has been renamed']);
|
||||
|
||||
const roots = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user