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:
Brian Vaughn
2019-10-09 12:37:25 -07:00
committed by GitHub
parent 4be45be5ff
commit 22b2642a56
2 changed files with 7 additions and 2 deletions

View File

@@ -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') {

View File

@@ -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 = [];