I'd like mock out MarkdownDeep, I've the following code, in JavaScript
MarkdownDeep = new (function () {
this.Markdown = function () {
this.Transform = function (a) {
return "html";
};
};
})();
but I'm having trouble implementing this in CoffeeScript
I tried the following
MarkdownDeep = new (->
@Markdown = ->
@Transform = (a) ->
"html"
)()
window.MarkdownDeep = MarkdownDeep
but it doesn't work, specifically in my unit test markdown = new MarkdownDeep.Markdown()
gives "undefined is not a function", though the JS version mocks out fine.