Debugging
The chart components can be debugged using few techniques.
-
Using browser developer tools.
- Open developer tools (Pressing
F12
). - Go to sources tab and open search bar (Pressing
Ctrl + Shift + F
). - Search for the component name and open the sources file from the search results.
- Apply breakpoints and run the scenario to see the breakpoints getting hit.
- Open developer tools (Pressing
-
Add console logs with the variables that you want to test. (Make sure to remove these logs while commiting your changes.)
-
Add a
debugger
statement wherever you want to debug. Open dev tools and run the scenario. The execution will pause once the debugger statement is hit. (Make sure to remove these logs while commiting your changes.) -
Debugging using test cases
- Open visual studio code from fluent ui root folder. (Not from
packages\react-charting
) - Check whether the
Debug current open test
debug option is visible under the run and debug tab. - Add breakpoints to the relevant test case and start debugging using
Debug current open test
option. Note that this option renders the components under a headless browser. So some actual rendering dependent functions likegetBoundingClientRect
will not work and will need to be mocked.
- Open visual studio code from fluent ui root folder. (Not from