The file I want to test is set up as an IIFE, which works great in the browser. I'm able to use the method renderInteractions
like so:
var something = utils.renderInteractions(doc);
However, when I run the test suite I get the following error:
TypeError: Object #<Object> has no method 'renderInteraction'
I found this Stack Overflow post which seems to indicate that your JavaScript file HAS to export something that Mocha can tap into: http://stackoverflow.com/questions/10204021/how-do-i-test-normal-non-node-specific-javascript-functions-with-mocha
But I'm not sure how to accomplish that.
Thanks Cory, that seems to cause it to fail in the browser though. This fork by @jcreamer898 does the trick:
https://gist.github.com/jcreamer898/8183519