Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Jonathan Creamer jcreamer898

🏠
Working from home
View GitHub Profile
View README.md

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