jest-to-log
Jest matchers for testing console messages and writes to stdout and stderr.
- Built with
- Node.js, Jest
function testFn() {
console.info("Jello", 1);
console.log("Jello", 2);
console.debug("Jello", 3);
}
const expectedString =
"Jello 1" + "\n" + "Jello 2" + "\n" + "Jello 3" + "\n";
expect(testFn).toLog(expectedString);