I’m working on an extension for testing in js using mocha. My current approach is to use a task to execute the tests, which works well… however I don’t seem to be able to actually capture that output outside of showing a text dump or scanning for errors. Is there any mechanism I can use to capture and process this output (ideally to process and display in a sidebar)?
Not from regular Tasks (such as those created by the user using a Custom Task).
The Process class allows an extension to execute a subprocess directly, capturing its output and processing it however it’d like. On its own, this isn’t usable by the Tasks feature, but Tasks resolved by an extension’s task assistant can be of the type TaskCommandAction (as opposed to the default / usual TaskProcessAction), which will invoke a named extension command which you can then handle the subprocess directly.
I hope this helps! If you find this isn’t sufficient for your needs, let us know.