console-pop

0.0.2 • Public • Published

console-pop

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

NPM

Build status

Example

var con = require('console-pop');
con.push();
// call other code that uses console.log
// a copy of the output is stored in con object
var str = con.pop()
// original console.log is restored
assert(/success/i.test(str), 'program reports success')

Small print

Author: Gleb Bahmutov © 2014

License: MIT - do anything with the code, but don't blame me if it does not work.

Spread the word: tweet, star on github, etc.

Support: if you find any problems with this module, email / tweet / open issue on Github

Readme

Keywords

Package Sidebar

Install

npm i console-pop

Weekly Downloads

14

Version

0.0.2

License

MIT

Last publish

Collaborators

  • bahmutov