Updated locations for custom element definitions to facilitate unit testing

3 views
Skip to first unread message

Tim Van der Lippe

unread,
May 6, 2021, 10:48:59 AM5/6/21
to devtools-dev

Hey everyone,


Over the past few weeks, we have been looking at improving the unit testability of various parts of DevTools. One of our findings was that, currently, it is more difficult than expected to test the reusable custom element implementations, as they are commonly bundled with other legacy (UI) code.


To facilitate unit testing, we separated out all custom element definitions from the various panels into components/ sub-folders. For example, all custom elements defined in panels/elements/ now live in panels/elements/components/. This ensures that panels/elements/components/ can be loaded and tested, without any of the legacy UI/SDK/etc... implementations to be available.


For all new custom elements, please put them in their respective components/ sub-folder of the panel you are working on, or in ui/components/ if the component is intended to be used in multiple panel implementations. With https://crrev.com/c/2874684 we are now enforcing these locations.


Let us know if you have any questions.


Cheers,

Tim & Jack

Reply all
Reply to author
Forward
0 new messages