Skip to content

Commit 22b2642

Browse files
author
Brian Vaughn
authored
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
1 parent 4be45be commit 22b2642

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

packages/react-devtools-shell/src/app/console.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ function ignoreStrings(
1111
methodName: string,
1212
stringsToIgnore: Array<string>,
1313
): void {
14-
const originalMethod = console[methodName];
14+
// HACKY In the test harness, DevTools overrides the parent window's console.
15+
// Our test app code uses the iframe's console though.
16+
// To simulate a more accurate end-ot-end ienvironment,
17+
// the shell's console patching should pass through to the parent override methods.
18+
const originalMethod = window.parent.console[methodName];
19+
1520
console[methodName] = (...args) => {
1621
const maybeString = args[0];
1722
if (typeof maybeString === 'string') {

packages/react-devtools-shell/src/app/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ignoreErrors([
3131
'Warning: Unsafe lifecycle methods',
3232
'Warning: %s is deprecated in StrictMode.', // findDOMNode
3333
]);
34-
ignoreWarnings(['Warning: componentWillReceiveProps is deprecated']);
34+
ignoreWarnings(['Warning: componentWillReceiveProps has been renamed']);
3535

3636
const roots = [];
3737

0 commit comments

Comments
 (0)