~/tmp/mocha ω cat test.js var assert = require('assert');var sinon = require('sinon');
describe('code', function() { var printStub;
beforeEach(function() { printStub = sinon.stub(); });
it('calls the print function', function() { runApp(printStub);
assert(printStub.called, 'console.log was called'); });});
function runApp(print) { print('running the code');} ~/tmp/mocha ω mocha test.js
code ✓ calls the print function
1 passing (7ms)
~/tmp/mocha ω