Testing a Brunched app using Mocha and including shims

pspklant

New Member
I'm trying to test my Brunch+Backbone application using MochaA Mocha spec that \[code\]require\[/code\]s various \[code\]devDependencies\[/code\] works fine. A Mocha spec that \[code\]requires\[/code\] my \[code\]devDependencies\[/code\] and modules from my app works so long as I adjust the \[code\]NODE_PATH\[/code\] variable\[code\]> NODE_PATH=./app mocha:)\[/code\]Failure occurs when my \[code\]require\[/code\]d application module requires code that's been shimmed in from the \[code\]vendor/scripts\[/code\] folder. These are simply unavailable to the \[code\]require\[/code\] system and it's not clear to me how to get them into scope before loading my application code.I can try using \[code\]brunch test\[/code\] in newer versions, but that seems to be broken as of today. I get a bug complaining about how in \[code\]test.js\[/code\] the function \[code\]helpers.findTestFiles\[/code\] doesn't exist. That issue has been filed, but it leads me to believe that Brunch isn't broken, I'm just doing things incorrectly.What is the right way to use Mocha to test a Brunch application using both AMD requires and shimmed vendor scripts (jQuery, Lodash, Backbone, Marionette)?
 
Back
Top