Skip to content

Instantly share code, notes, and snippets.

@jchannon
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jchannon/83258bd7f144f0a294be to your computer and use it in GitHub Desktop.
Save jchannon/83258bd7f144f0a294be to your computer and use it in GitHub Desktop.
module.exports = (function () {
var constructor = function (timer) {
console.log('hi');
timer.Start();
return 666;
}
return constructor;
})();
var assert = require("assert")
var sinon = require('sinon');
var mmsProcessor = require('../MMS/MMSProcessor.js');
describe('MMSProcessor', function(){
describe('DownloadFiles', function(){
it('should start timer', function(){
var myAPI = { Start: function () {} };
var mock = sinon.mock(myAPI);
mock.expects("Start").once();
mmsProcessor(mock);
mock.verify();
})
})
})
// when i runt the test i get TypeError: Object #<Object> has no method 'Start'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment