universal-stream-test
the simplest way to run tests against your console/stdout, works in-browser and in Node.js, used to test morgan-body: https://github.com/sirrodgepodge/morgan-body/
Usage
Just pass in a function for each line of console that you would like to test, each function will be fed the output corresponding to that line.
; { console; console; console; console;} ;
Options
By default tests 'process.stdout' if run in Node.js and 'console.log' if run in a browser, however it can be used to test any stream.
; const configuredStreamTest = universalStreamTest; // example usage testing console.warnconst consoleWarnTest = universalStreamTest; { console; console;}