MCPcopy Index your code
hub / github.com/react/react / main

Function main

packages/react-devtools-extensions/firefox/test.js:34–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

32};
33
34const main = async () => {
35 const finder = new Finder();
36
37 const findPathPromise = new Promise((resolvePromise, rejectPromise) => {
38 finder.getPath(getFirefoxProfileName(), (error, profile) => {
39 if (error) {
40 rejectPromise(error);
41 } else {
42 resolvePromise(profile);
43 }
44 });
45 });
46
47 const options = [
48 `--source-dir=${EXTENSION_PATH}`,
49 `--start-url=${START_URL}`,
50 '--browser-console',
51 ];
52
53 try {
54 const path = await findPathPromise;
55 const trimmedPath = path.replace(' ', '\\ ');
56 options.push(`--firefox-profile=${trimmedPath}`);
57 } catch (err) {
58 console.warn('Could not find default profile, using temporary profile.');
59 }
60
61 try {
62 await exec(`web-ext run ${options.join(' ')}`);
63 } catch (err) {
64 console.error('`web-ext run` failed', err.stdout, err.stderr);
65 }
66};
67
68main();

Callers 1

test.jsFile · 0.70

Calls 5

getFirefoxProfileNameFunction · 0.85
execFunction · 0.85
joinMethod · 0.80
pushMethod · 0.65
errorMethod · 0.65

Tested by

no test coverage detected