A couple tips:
* I wouldn’t say this speeds up startup (quite the opposite), but you can run `./mach mochitest path/to/some/test.js —jsdebugger` and throw a debugger statement at the start of the test case. Once it pauses you will have access to all of the head.js functionality so you can run code and try things out.
* I often do a `yield new Promise(() => {});` inside of a task to get execution to stop and let me investigate the state of the UI. You can from there open up a Browser Console / Browser Toolbox and take a look at errors in console / run code (global scope) if you need to dig in further. Then once I figure out what I needed, I ctrl+c on the terminal that started the test and repeat. Or `yield new Promise(resolve => {setTimeout(resolve, 1000)});` if you want things to slow down a bit and watch what is happening.
* Or as I just discovered looking at the help for the command, there is a --debug-on-failure option that is intended to pause the debugger when a test fails (haven’t tried that yet).
Brian
> On Oct 4, 2015, at 12:55 PM, Hallvord Reiar Michaelsen Steen <
hst...@mozilla.com> wrote:
>
> Hi all,
> maybe just because I'm new to it.. but it seems to be very time consuming
> to write tests for devtools. I make a tweak, run "mach mochitest
> path/to/some/test.js", wait - sometimes for a long time if I'm making
> mistakes that cause timeouts. Rinse and repeat. Do you have any tricks for
> speeding this up? Is there for example a way to load a "scratchpad" running
> in the right context with head.js injected to be able to try out commands
> immediately?
> -Hallvord
> _______________________________________________
> dev-developer-tools mailing list
>
dev-devel...@lists.mozilla.org
>
https://lists.mozilla.org/listinfo/dev-developer-tools