I am using mocha for unit testing.I have used foundation library and have initialized it in componentDidMount() and componentDidUpdate() as below
componentDidMount(){
$("#element").foundation();
}
In testutils setup file i have initialized
global.jQuery = require('../node_modules/jquery/dist/jquery');
global.$ = global.jQuery;
global.window.jQuery = global.jQuery;
global.window.$ = global.jQuery;
global.Foundation=require('../node_modules/foundation-sites/dist/foundation');
global.window.Foundation=global.Foundation
I am getting this error
D:\xxxx\xxxxx\xxxx\node_modules\foundation-sites\dist\foundation.js:391
Foundation.Box = {
^
ReferenceError: Foundation is not defined
Please let me know how to import foundation and mock .foundation() method.