I think there is an issue when you use spyOn. SpyOn changes the function that is exposed through the exports object. When getClientID(...) calls get _getExtensionPaths(), it's not calling the function that was replaced through spyOn. There seem to be different references to the this function and calling in inside the module, will always call the original one. We had a discussion here yesterday about this and possible solutions. Finally we came up with the little change to make the unit tests work.