From 0836f62a5bd305d8f901e3b4645613e990f09d6e Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Tue, 23 Jun 2020 11:48:35 -0400 Subject: [PATCH] Updates the DevTools test script to make it easier to test other URLs. (#19179) --- .gitignore | 1 + packages/react-devtools-extensions/chrome/test.js | 14 ++++++++++++-- packages/react-devtools-extensions/edge/test.js | 4 +++- packages/react-devtools-extensions/firefox/test.js | 3 ++- scripts/flow/config/flowconfig | 1 + 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 0e13bfc92606c..2a70572385027 100644 --- a/.gitignore +++ b/.gitignore @@ -32,5 +32,6 @@ packages/react-devtools-extensions/firefox/build packages/react-devtools-extensions/firefox/*.xpi packages/react-devtools-extensions/firefox/*.pem packages/react-devtools-extensions/shared/build +packages/react-devtools-extensions/.tempUserDataDir packages/react-devtools-inline/dist packages/react-devtools-shell/dist \ No newline at end of file diff --git a/packages/react-devtools-extensions/chrome/test.js b/packages/react-devtools-extensions/chrome/test.js index 12cc838b20907..833990525e721 100644 --- a/packages/react-devtools-extensions/chrome/test.js +++ b/packages/react-devtools-extensions/chrome/test.js @@ -4,10 +4,20 @@ const chromeLaunch = require('chrome-launch'); const {resolve} = require('path'); +const {argv} = require('yargs'); const EXTENSION_PATH = resolve('./chrome/build/unpacked'); -const START_URL = 'https://facebook.github.io/react/'; +const START_URL = argv.url || 'https://reactjs.org/'; chromeLaunch(START_URL, { - args: [`--load-extension=${EXTENSION_PATH}`], + args: [ + // Load the React DevTools extension + `--load-extension=${EXTENSION_PATH}`, + + // Automatically open DevTools window + '--auto-open-devtools-for-tabs', + + // Remembers previous session settings (e.g. DevTools size/position) + '--user-data-dir=./.tempUserDataDir', + ], }); diff --git a/packages/react-devtools-extensions/edge/test.js b/packages/react-devtools-extensions/edge/test.js index b18ec386d9ba0..f24b403da655b 100644 --- a/packages/react-devtools-extensions/edge/test.js +++ b/packages/react-devtools-extensions/edge/test.js @@ -5,10 +5,12 @@ const open = require('open'); const os = require('os'); const osName = require('os-name'); -const START_URL = 'https://facebook.github.io/react/'; const {resolve} = require('path'); +const {argv} = require('yargs'); const EXTENSION_PATH = resolve('./edge/build/unpacked'); +const START_URL = argv.url || 'https://reactjs.org/'; + const extargs = `--load-extension=${EXTENSION_PATH}`; const osname = osName(os.platform()); diff --git a/packages/react-devtools-extensions/firefox/test.js b/packages/react-devtools-extensions/firefox/test.js index 754c2f05e79b7..4b0f5f04c7fbb 100644 --- a/packages/react-devtools-extensions/firefox/test.js +++ b/packages/react-devtools-extensions/firefox/test.js @@ -5,9 +5,10 @@ const {exec} = require('child-process-promise'); const {Finder} = require('firefox-profile'); const {resolve} = require('path'); +const {argv} = require('yargs'); const EXTENSION_PATH = resolve('./firefox/build/unpacked'); -const START_URL = 'https://facebook.github.io/react/'; +const START_URL = argv.url || 'https://reactjs.org/'; const main = async () => { const finder = new Finder(); diff --git a/scripts/flow/config/flowconfig b/scripts/flow/config/flowconfig index 6001befd79b45..79789c4ec56ae 100644 --- a/scripts/flow/config/flowconfig +++ b/scripts/flow/config/flowconfig @@ -1,6 +1,7 @@ [ignore] .*/scripts/bench/.* .*/build/.* +.*/.tempUserDataDir/.* # These shims are copied into external projects: .*/rollup/shims/facebook-www/.*