Easy way to capture `console.log` output, for example for unit testing