I'm writing an emacs package for Pipenv and the spike solution uses sync shell calls, which is not desirable for general usage. I'm now changing calls to be async (make-process
) and for output to go to a dedicated buffer. This is all good and works. However, I now want to update my test suite. I'm not sure on the best (practice) way to:
- Wait on the output of
make-process
for testing purposes. I am usingaccept-process-output
but it does not return the actual output, onlyt
. - Related, perhaps provide a custom filter for use in testing that collects the output into a value I can return and do assertions against.
What is the best way to test output that is normally sent to a buffer via an async shell command call?
make-process
you need aprocess-filter
or/andprocess-sentinel
. You should look at other packages how this is done. I would suggest to use xref. You have to set a filter/sentinel for a process and they receive the process and the output as arguments. It's really convenient to look at the output of a process this way.