Can't you expose the internal methods individually via the module for testing purposes without making them vulnerable to manipulation as they are used by the public methods?
Just tried this in the developer console:
// module 'm' exposes 'p' that uses 'f' internally. Exposes
// 'f' for testing purposes.
var m = (function() { var f = function() { return 'a'; }; var p = function() { return f(); }; return {'p': p, 'internalF': f};})();
m.p();
// 'a'
m.internalF();
// 'a'
m.internalF = function() { return 'haxor';};
m.internalF();
// 'haxor'
m.p();
// 'a'
Comments
Can't you expose the internal methods individually via the module for testing purposes without making them vulnerable to manipulation as they are used by the public methods?
Just tried this in the developer console: