Suppose, I have a.js located in xyz/module1 path. I want to call checkEmpty function in my mocha test case located in xyz/module2. a.js :
function checkEmpty(val){
if(val != null && val != ""){
return false;
}
return true;
}
testcase.js:
describe('testcase', function () {
var val = "";
it('Validating empty string', () => {
//call checkEmpty
});
});
I can achieve it by exporting the function in a.js but I don't want to use the export statement. Can someone help me with this?