Modify createHost helper in devtools/client/shared/test/head.js to return an object instead of an array
Categories
(DevTools :: Console, task, P3)
Tracking
(firefox75 fixed)
Tracking | Status | |
---|---|---|
firefox75 | --- | fixed |
People
(Reporter: nchevobbe, Assigned: manas.khurana20, Mentored)
Details
(Keywords: good-first-bug)
Attachments
(1 file)
The createHost
helper (devtools/client/shared/test/head.js#112-125 ) which is used in tests return an array with 3 element:
- host
- iframe.contentWindow
- iframe.contentDocument
most of the time, the test does not need all those, which can result in less than ideal destructuring (e.g. const [, , doc] = await createHost("bottom", TEST_URI);
)
We should modify the function so it returns an object like with the host
, contentWindow
and contentDocument
properties.
With that done, the tests calling the helper (https://searchfox.org/mozilla-central/search?q=createHost(&case=true®exp=false&path=devtools%2Fclient%2Fshared%2F) should be updated.
Reporter | ||
Comment 2•5 years ago
|
||
Hello manas, thanks for offering help!
The bug is now yours :)
If it's your first bug, you might want to read this https://docs.firefox-dev.tools/getting-started/ to setup the work environment.
Make sure to select "Artifact builds" when asked as it speeds up the workflow quite a bit :)
After you made the changes, you can run the tests with ./mach mochitest devtools/client/shared/test/ --headless
to ensure everything is okay.
Also, you can come and chat on our Slack https://devtools-html-slack.herokuapp.com/
Reporter | ||
Comment 6•5 years ago
|
||
yes this looks good, I pushed the patch
Comment 7•5 years ago
|
||
bugherder |
Description
•